So what is your end goal – you need more precision in the output?
Marc Funaro
From: cfu...@googlegroups.com [mailto:cfu...@googlegroups.com] On Behalf Of Steel Valor
Sent: Thursday, March 30, 2017 8:17 AM
To: Central New York ColdFusion Users Group
Subject: [cfugcny] How can I display (and do math with decimals like 0.000005?
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
--
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.
I have a feeling this is a database driver issue… what driver are you currently using for the DSN, odbc?
From: cfu...@googlegroups.com [mailto:cfu...@googlegroups.com] On Behalf Of Steel Valor
Sent: Thursday, March 30, 2017 9:14 AM
To: Central New York ColdFusion Users Group
Subject: Re: [cfugcny] How can I display (and do math with decimals like 0.000005?
Also, can you provide code, and are you using ORM?
From: cfu...@googlegroups.com [mailto:cfu...@googlegroups.com] On Behalf Of Steel Valor
Sent: Thursday, March 30, 2017 9:14 AM
To: Central New York ColdFusion Users Group
Subject: Re: [cfugcny] How can I display (and do math with decimals like 0.000005?
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.
On Thursday, March 30, 2017 at 8:39:40 AM UTC-4, Marc Funaro wrote:
So it sounds like you *were* getting the correct value back from the database, the problem was in the view.
Marc Funaro
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
--
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.