Rounding
I'm using RB 10.09 and I have a currency field in a database table with the
value 0.065
If I display the field with the format: $#,0.00;-$#,0.00 the field is
displayed as ?0.07
However if I display the field with the format #,0.00;-#,0.00 the field is
displayed as 0.06
Why is there this discrepancy?
Best regards,
Simon
value 0.065
If I display the field with the format: $#,0.00;-$#,0.00 the field is
displayed as ?0.07
However if I display the field with the format #,0.00;-#,0.00 the field is
displayed as 0.06
Why is there this discrepancy?
Best regards,
Simon
This discussion has been closed.
Comments
All formatting is taken care of in the ppDisplayFormat.pas file. If you
take a look at the TppDisplayFormat.Format routine, you can see that if a
"$" is detected in the display format, the FloatToStrF routine is used to
get the value. Otherwise the FormatFloat routine is used.
It is possible to completely replace this class with your own using the
global variable gcDisplayFormat located in the ppUtils.pas file.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for that. Sorted it by including a custom version of the
ppDisplayFormat.pas file my application source folder.
Best regards,
Simon