Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not displaying trailing zeros
Message
From
09/08/2005 13:13:10
 
 
To
08/08/2005 22:32:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01039444
Message ID:
01039588
Views:
20
>>Hi all,
>>
>>My user doesn't want to see trailing zeros after the decimal beyond the second decimal place in a report. For example:
>>
>>If the value is 12.345, he wants to see 12.345 print.
>>
>>If the value is 12.340, he wants to see 12.34 print.
>>
>>How would I do this?
>>
>>Thanks very much!
>>
>>John
>
>The data can be transformed as follows: replace zeroes with spaces, apply alltrim(), replace spaces with zeroes again. This will take out all superfluous zeroes; in your case, you will have to add up to two zeroes again.
>
>You will probably want to put all this into a UDF.

John uses vfp6, so your advice is best. In vfp9, the TRIM function can be used to remove other trailing characters too, so not only spaces.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform