Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you align a number on a report by the decimal point?
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00302779
Message ID:
00302891
Views:
33
>That didn't work. The right ) for the negative number prints in the "pennies" column. Therefore, they line up like:
>(100.00)
> 200.00
>Any other ideas?

Sorry, I totally over-looked the part where you want negative numbers in parenthese. By using the parens, you are altering the output format of the numbers. I have always just used negative numbers and never had to figure out a solution to your problem. I am sure someone has done this and has a much better solution. All I can think of at the moment is to use an IIF() in the field expression and convert the number to a string.

iif(field1 < 0, lpad(field1, " ", 9), lpad(field1, " ", 12))

For the lpad(..., 12), you would have to figure out how many spaces the left paren actually takes up based on the font and size and use that.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform