Rounding Discrepancy
Working with D7 and RB9.02, I'm getting different values displayed from the
same value depending upon if the value is pulled from a database field or as
a calculation.
The situation that I have is that I have a calc value that calculates the
cost * quantity where the cost = 0.4110 and the quantity is 25. The result
of this is 10.275. When printed on the report with a DBText value set to
display just 2 decimal places, it displays 10.27. But if I create a Calc
field (double) with the calculation as Value := 25 * 0.4110 and display it
set to 2 decimal places it displays as 10.28.
Is this a known issue and if so, is there a fix available.
--
---------------------------------------
Terry Swiers
Millennium Software, LLC
http://www.1000years.com
http://www.atrex.com
Atrex Inventory Control/POS -
Big business features without spending big business bucks!
Atrex Electronic Support Options:
Atrex Knowledgebase: http://www.atrex.com/atrexkb.cfm
Email: mailto:support@atrex.com
same value depending upon if the value is pulled from a database field or as
a calculation.
The situation that I have is that I have a calc value that calculates the
cost * quantity where the cost = 0.4110 and the quantity is 25. The result
of this is 10.275. When printed on the report with a DBText value set to
display just 2 decimal places, it displays 10.27. But if I create a Calc
field (double) with the calculation as Value := 25 * 0.4110 and display it
set to 2 decimal places it displays as 10.28.
Is this a known issue and if so, is there a fix available.
--
---------------------------------------
Terry Swiers
Millennium Software, LLC
http://www.1000years.com
http://www.atrex.com
Atrex Inventory Control/POS -
Big business features without spending big business bucks!
Atrex Electronic Support Options:
Atrex Knowledgebase: http://www.atrex.com/atrexkb.cfm
Email: mailto:support@atrex.com
This discussion has been closed.
Comments
ReportBuilder uses the FloatToStrF method to format and round all values
with a display format. See this topic in the delphi help for more
information on how it works. Be sure your TppVariable is defined with the
same datatype as your data files (i.e. Currency) to ensure identical
rounding will occur.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Understood. If I can provide a small reproducible example of this, would
you like me to send this to the support email?
--
---------------------------------------
Terry Swiers
Millennium Software, LLC
http://www.1000years.com
http://www.atrex.com
Atrex Inventory Control/POS -
Big business features without spending big business bucks!
Atrex Electronic Support Options:
Atrex Knowledgebase: http://www.atrex.com/atrexkb.cfm
Email: mailto:support@atrex.com
If you are seeing a descrepancy between two values with the same datatype
and display format, please send a small example demonstrating this to
support@digital-metaphors.com.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com