Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transform(x,?????)
Message
From
06/01/2005 16:04:57
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00974835
Message ID:
00974836
Views:
30
This message has been marked as a message which has helped to the initial question of the thread.
Write your own UDF.

First, replace all "0" with space, use alltrim(), and replace space back to "0". That will clear unneeded zeroes at the end.

Then, you may want to conditionally add a zero to the left, to change ".53" to "0.53".

Finally, apply the special rules about the number of decimals which you mentioned.

HTH,

Hilmar.

>Hi guys...
>
>I have a field NUMERIC N (12,6) and this field is populate with some values. Example:
>
>
>  12.210000
> 145.245000
>1524.352000
>  1.3562400
> 15.2546423
>
>
>Ok... no problem here... but I have to print these numbers like that:
>
>
>  12.21000 ->   12.21
> 145.24500 ->  145.245
>  54.00000 ->   54.00
>1524.35200 -> 1524.352
>  1.356240 ->    1.35624
> 15.254642 ->   15.254642
>
>
>I'm using ??? Tran(MyField,"??????????") to print this report... and I have to print, at least, two decimals... but if the number has more than two decimals, I have to print them, until completed six positions.
>
>Any idea to change ??????? for a solution? :-)
>
>TIA!
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform