Jump to content

Negative numbers to zero


Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...