Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transform() ?
Message
From
08/12/2001 07:34:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Miscellaneous
Thread ID:
00591318
Message ID:
00591643
Views:
22
>What's wrong with this (in both VFP6 and VFP7):
>
>? TRANSFORM(18.1234567,"99.9999%")
>
>it show 18.1200%
>
>Should it be 18.1234% ?
>
>TIA
>
>Jun

Transform() respects decimals and like str() it rounds the value to the given decimals.
With decimals 4 setting transform would return same as str(,7,4) where both requests roundation to 4th. If what you really want is 18.1234% and not 18.1235% than still way to go is transform. With no mask defined transform returns char representation of number whatever the decimal setting is. You apply another transform to apply the mask :

?transform(transform(18.1234567),'99.9999%')

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform