I'm passing a field to a library method and although the field in the table is 4 decimal positions, the library methond only appears to get 2. i.e. data is .0025 but method only gets .00
Why?
The problem is probably not with the library but with the way Paradox handles numbers in variables, by default it rounds them to 2 decimal places. I have a couple of solutions,
1, In the windows Control Panel change the "Regional and Language Options" set the number of digits after the decimal from 2 to 4. This will solve the problem but it will affect all windows applications.
2, Create a custom number format with 4 digits after the decimal (be sure and make it permanent), and using objectPal define it, this will last throughout the Session. Below is an example
var
n Number
endvar
n = .0025
n.view(); variable with Paradox default
formatSetNumberDefault ( "NewNumberFormat"
n.view() ; variable with new format
Keep in mind that there's a difference between the precision of the value and the precision that Paradox displays for a floating point (or currency) number.
Perrin's idea helps you manage the display of the value (which Paradox will almost always round to some preset precision).
For some examples of how to control the underlying value in the field, please see
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.