General information
Category:
Coding, syntax & commands
Title:
Need a function to strip off zero-filled decimals
I must be suffering from temporary brainlock, but I need a function that will remove the zeros from the decimal portion of a number, without changing the SET("DECIMALS") setting.
Example: I have a variable that contains the number 8.50000. I want to pass that through a VFP function and have it return 8.5. Passing 8.50001 will return 8.50001, regardless of what my SET("DECIMALS") setting is.
While I'm at it, is there a function that will tell you the number of decimals in a numeric?
Example 2: I have a variable that contains the number 12.345. Passing it through the decumal counter function will return 3. Passing 99.5000 will return 4, and passing 144 will return 0, again without querying or changing the SET("DECIMALS") setting.
TIA,
Bill
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only