Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Full field not passed to library method

Status
Not open for further replies.

Rhondae

Programmer
Feb 28, 2003
1
CA
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?
 
Rhondae,

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


Good luck
Perrin
 
Rhondae,

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 for some examples.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top