I remember someone raising this issue yonks ago in CF 4.5 or something A quick fix: #round((1024-1024.1)*100000)/100000#
On Wed, 2007-02-21 at 13:38 +1100, Robin Hilliard wrote: > > What exactly is a 'CF number'? > > All simple CF variables are stored as strings. When used as numbers > in an expression they have 12 significant digits according to the > documentation, which I assume is a java Float (a Double would have > more). > > As for a solution in CFML, I wouldn't mind an optional second > argument to round(), fix(), ceil() etc that defaulted to 0 and > specified the number of decimal places to round to (Excel VBA has this). > > I imagine that changing the type used to represent numbers internally > or building rounding into all number handling may impact legacy cf > apps and server performance - I would be against a change if either > were true. > > Cheers, > Robin > > > ______________ > > Robin Hilliard > Director - RocketBoots Pty Ltd > Consulting . Recruitment . Software Licensing . Training > http://www.rocketboots.com.au > > For schedule/availability call Pamela Higgins: > w +61 7 5451 0362 > m +61 419 677 151 > f +61 3 9923 6261 > e [EMAIL PROTECTED] > > or Direct: > m +61 418 414 341 > e [EMAIL PROTECTED] > > > On 21/02/2007, at 10:32 AM, Rod Higgins wrote: > > > > > Hi Robin, > > > > What exactly is a 'CF number'? It seems to be CF can store it as a > > string or > > a double / float depending on the way it is constructed or what > > methods are > > used on the var. I agree with Gareth in that CF needs to make untyped > > numbers in CF more consistent. The values generated from Gareth's code > > shouldn't happen and no I don't agree with the opinion it is a > > fault / known > > issue of the Java language, it is simply the way CF was written to > > use Java. > > They decided to go with a smaller memory footprint for storing numeric > > values. This is a very annoying issue when dealing with very small > > numbers > > in CF and has driven me nuts plenty of times before. > > > > Obviously using BigDecimal for every numeric in CF would use too > > much memory > > but maybe some option for the construction of 'CF numbers' so > > developers can > > choose to be more precise. > > > > Rod > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---