RE: [cfugcny] How can I display (and do math with decimals like 0.000005?

11 views
Skip to first unread message
Message has been deleted

Marc Funaro

unread,
Mar 30, 2017, 8:39:40 AM3/30/17
to cfu...@googlegroups.com

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

 

Marc Funaro

Advantex LLC

607-336-6895

 

 

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.

Message has been deleted

Marc Funaro

unread,
Mar 31, 2017, 8:42:09 AM3/31/17
to 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

Advantex LLC

607-336-6895

 

 

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.

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

 

Marc Funaro

unread,
Mar 31, 2017, 8:48:59 AM3/31/17
to cfu...@googlegroups.com

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

 

Marc Funaro

Advantex LLC

607-336-6895

 

 

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.

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

 

 

 



On Thursday, March 30, 2017 at 8:39:40 AM UTC-4, Marc Funaro wrote:

Message has been deleted

Marc Funaro

unread,
Mar 31, 2017, 9:32:37 AM3/31/17
to 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

 

--
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.

Reply all
Reply to author
Forward
0 new messages