Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ToText with negative number formating question 1

Status
Not open for further replies.

mweaver

Programmer
Oct 25, 2000
1
US
I have a formula which strings together various two text fields and a numeric field. I need the two text fields left justified and the numeric right justified. This is my formula:

{activity.Group} + {activity.Suffix} + ToText(Round({activity.Amount},2)*100,"##############")

And this works great for positive numbers. When a negative is thrown in, I get formatting like this:
00000000- 1000
where I would like to have:
00000000 -1000
Any ideas?

 
The problem is due to the default format you use in your Windows for the display of negatives - which is fixed, left justified negative sign.
While you can change your default Windows environment, it would probably be better to alter the formula to work under any Windows environment.
I have also taken out the Round function, as the
ToText(x,y) appears to take care of that.
{activity.Group} + {activity.Suffix} +
(
If {activity.Amount} > 0 then
ToText({activity.Amount} * 100, "####")
Else
'-' + ToText(Abs({activity.Amount}) * 100, "####")
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top