Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trim trailing zeroes
Message
From
22/10/2013 18:27:10
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
 
 
To
22/10/2013 17:57:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01586185
Message ID:
01586188
Views:
58
>I'm embarrassed to ask this:
>
>I can't figure out how to display a numeric value with the trailing zeroes trimmed. So, if the value is stored in the table as 88.99000, I want the value to display in a report as 88.99.

Do you want to always trim off any trailing zeroes, or do you want to always display a fixed number of decimal places?

The former is unusual in my experience. In cases where things such as parts prices are recorded to fractions of a cent, users often want to see those fractions even if they are zero, to confirm that's the value and not some rounded amount.

If you have values like 88.991 or 88.9901, then trimming trailing zeroes will lead to a ragged right edge in columns of numbers on a report and/or inconsistent position of the decimal point, both of which can make a report harder to read.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform