Expand my Community achievements bar.

Making a numeric field negative

Avatar

Former Community Member
I have a form that I'm trying to make a numeric field a negative value. I would like for the user to enter either "-100" or "100" and the output be "$-100". I guess I need to take the absolute value and then format the display pattern to include the "-" but I can't figure out how to get the absolute value to display. I've tried: abs(fld_DollarAmt) in the exit event but this doesn't seem to work. Can someone help me?
1 Reply

Avatar

Former Community Member
This is probably a stupid way - but it might do what you want (?)



if (this.rawValue > 0)



this.rawValue = "$" + -this.rawValue;



else



this.rawValue = "$" + this.rawValue;



or if you're sorting the currency format somewhere else.. I guess you'd prefer to do that..



if (this.rawValue > 0)



this.rawValue = -this.rawValue;