How can I display (and do math with decimals like 0.000005?

7 праглядаў
Перайсці да першага непрачытанага паведамлення

Steel Valor

не прачытана,
30 сак 2017 г., 08:16:5730.03.17
да Central New York ColdFusion Users Group
Hi,

 So I need to do some billing calculations for printing. The cost of ink per page is microscopic but when you run a million pages it adds up. Suggestions? I can't seem to break it out past 0.00 using DecimalFormat.

Thanks

Marc Funaro

не прачытана,
30 сак 2017 г., 08:39:4030.03.17
да cfu...@googlegroups.com

So what is your end goal – you need more precision in the output?

 

Marc Funaro

Advantex LLC

607-336-6895

--
You received this message because you are subscribed to the Google Groups "Central New York ColdFusion Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfugcny+u...@googlegroups.com.
To post to this group, send email to cfu...@googlegroups.com.
Visit this group at https://groups.google.com/group/cfugcny.
For more options, visit https://groups.google.com/d/optout.

Steel Valor

не прачытана,
30 сак 2017 г., 09:13:4830.03.17
да Central New York ColdFusion Users Group
Here's what I am doing. Anything CF retrieves or displays from the db is shown as 0.00 or 0. I've attached a jpg of what the "quantity" should look like in this case.

CF10+ MySQL5+ (the fields in question are types as Decimal 12,6

Marc Funaro

не прачытана,
31 сак 2017 г., 08:42:0931.03.17
да cfu...@googlegroups.com

I have a feeling this is a database driver issue… what driver are you currently using for the DSN, odbc?

Marc Funaro

не прачытана,
31 сак 2017 г., 08:48:5931.03.17
да cfu...@googlegroups.com

Also, can you provide code, and are you using ORM?

Ed Salsberg

не прачытана,
31 сак 2017 г., 09:29:1231.03.17
да cfu...@googlegroups.com
Fixed it with <input type="text" value="#numberFormat(quantity,'__.000000')#" name="quantity" size="14" style="text-align:right">  I had no idea that NumberFormat had decimal formatting. 

_________________________________
Former Video Game & Heavy Metal Industry Insider

To unsubscribe from this group and stop receiving emails from it, send an email to cfugcny+unsubscribe@googlegroups.com.


To post to this group, send email to cfu...@googlegroups.com.
Visit this group at https://groups.google.com/group/cfugcny.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Central New York ColdFusion Users Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cfugcny/aIQUYRqCQ14/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cfugcny+unsubscribe@googlegroups.com.

Marc Funaro

не прачытана,
31 сак 2017 г., 09:32:3731.03.17
да cfu...@googlegroups.com

So it sounds like you *were* getting the correct value back from the database, the problem was in the view.

 

Marc Funaro

Advantex LLC

607-336-6895

 

 

From: steel...@gmail.com [mailto:steel...@gmail.com] On Behalf Of Ed Salsberg
Sent: Friday, March 31, 2017 9:29 AM
To: cfu...@googlegroups.com
Subject: Re: [cfugcny] How can I display (and do math with decimals like 0.000005?

 

Fixed it with <input type="text" value="#numberFormat(quantity,'__.000000')#" name="quantity" size="14" style="text-align:right">  I had no idea that NumberFormat had decimal formatting. 


_________________________________

Former Video Game & Heavy Metal Industry Insider

 

On Fri, Mar 31, 2017 at 8:41 AM, Marc Funaro <ma...@advantex.net> wrote:

I have a feeling this is a database driver issue… what driver are you currently using for the DSN, odbc?

 

Marc Funaro

Advantex LLC

607-336-6895

 

 

From: cfu...@googlegroups.com [mailto:cfu...@googlegroups.com] On Behalf Of Steel Valor

--

You received this message because you are subscribed to a topic in the Google Groups "Central New York ColdFusion Users Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cfugcny/aIQUYRqCQ14/unsubscribe.

To unsubscribe from this group and all its topics, send an email to cfugcny+u...@googlegroups.com.


To post to this group, send email to cfu...@googlegroups.com.
Visit this group at https://groups.google.com/group/cfugcny.
For more options, visit https://groups.google.com/d/optout.

Адказаць усім
Адказаць аўтару
Наперад
0 новых паведамленняў