Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Decimals
Message
From
25/07/2006 10:10:28
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
25/07/2006 09:56:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MySQL
Miscellaneous
Thread ID:
01139684
Message ID:
01139695
Views:
8
>hi
>a simple question, i want to display in a label a decimal number, i declared that
>number as double and put set decimal to 2 in the load method, but the label dont display the decimal just the aprox. integer value
>how can i fix this?

You have to convert to text, I think. You aren't perchance using str(MyNumber)? That would strip the decimals. You might use any of the following for ThisForm.MyLabel.Value:
  • alltrim(str(MyNumber, 2))
  • alltrim(transform(MyNumber, "###,###.##"))
  • alltrim(padl(MyNumber))
  • transform(MyNumber)

    HTH,

    Hilmar.
    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
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform