Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Format in report
Message
From
24/05/2009 12:36:12
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
24/05/2009 11:57:18
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01401692
Message ID:
01401693
Views:
59
A fixed format could be something like transform(fieldname, "###,###.##") - the tricky part is to convert this to a variable format. Something like this (not tested):

transform(FieldName, "###,###" + iif(num_of_showed_decimal_places > 0, ".", "") + replicate("#", num_of_showed_decimal_places)

>I have a table with the fields:
> codigo c(10),designacao c(40),value n(6,2),num_of_showed_decimal_places i(4)
>I want to condicionaly show in the report the value with zero,one or two decimal place acording with the(num_of_showed_decimal_places)
>
>1º If the value stored in the table is 10.22 and the num_of_showed_decimal_places=2 The report show 10.22
>2º If the value stored in the table is 10.20 and the num_of_showed_decimal_places=1 The report show 10.2
>3º If the value stored in the table is 10.20 and the num_of_showed_decimal_places=0 The report show 10
>
>Sorry for my bad English.
>Thanks in advance.
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