Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Format a field to not show trailing Zeros in decimals.
Message
From
04/08/2000 13:26:09
 
 
To
04/08/2000 10:20:18
Tom Gahagan
Alliance Computer Solutions
Thomaston, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00400906
Message ID:
00401194
Views:
20
>Tim...
>
>I think this will better suit your needs. At least I hope so! :)
>set decimals to 10
>
>mtest= 234.123456700 (or what ever number)
>mval=alltrim(str(mtest,45,10))
>
>*test for decimal place.....
>mdec=occurs('.',mval)
>
>if mdec > 0 && there is a decimal
> && split string into right and left portions
> && include decimal in the left
> mleft = substr(mval,1,at('.',mval))
> mright=substr(mval,(at('.',mval)+1),10)
> && now that you have the portion to the right of the decimal...test for "0"
> if occurs('0',mright) > 0 && extract portion with numbers
> mright = substr(mright,1,at('0',mright)-1)
> endif
> && put strings back together
> mstring = mleft+mright
>else && no decimal
>
> mstring=mval
>
>endif
>
>?mstring
>
>Hope this helps you with our problem!

Keep trying... 23.0714
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform