ColorPage Posted June 20, 2017 Share Posted June 20, 2017 Hello, I have a column that has amounts which can be a positive number (money owed), a negative number (money in the account) or 0. Is there a rule that will cause all values with a negative number to show up as "0" instead? Thank you. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 20, 2017 Share Posted June 20, 2017 return Math.max(0, StringToNumber(Field("Balance"))); Quote Link to comment Share on other sites More sharing options...
ColorPage Posted June 20, 2017 Author Share Posted June 20, 2017 return Math.max(0, StringToNumber(Field("Balance"))); Thank you for the response. I'm not very familiar with Javascript so maybe you can help me out a little further. There is already a script in place to format the column: var acctbal = FormatNumber("#,###.00",Field("ACCTBAL")) return "$"+acctbal; How can I add add the two scripts together? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted June 21, 2017 Share Posted June 21, 2017 return FormatNumber("$#,###.00", Math.max(0, StringToNumber(Field("ACCTBAL")))); Quote Link to comment Share on other sites More sharing options...
ColorPage Posted June 21, 2017 Author Share Posted June 21, 2017 return FormatNumber("$#,###.00", Math.max(0, StringToNumber(Field("ACCTBAL")))); Thank you. Much appreciated. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.