Jump to content

formatting numbers


ehigginbotham

Recommended Posts

I have the following rule which works great until the return is not formatted correctly.

CustTypeSplit=Field("LASTGIFT").split(".")

Number=CustTypeSplit[0]

decimal=CustTypeSplit[1]

var nocomma= Field("LASTGIFT").replace(/\,/g, "");

var G2=nocomma*1.5

var formattedG2=FormatNumber("#,###.##", G2)

if (Number <=19.99)

return 40;

else return formattedG2;

 

basically, if the number is 19.99 or less, I want it to return 40. if its greater than that I want it to return the number multiplied by 1.5. which works until its a number like 35, which comes out to 52.5. I would like it to return 52.50. I know its something simple in the formatting of it, but I don't know how to do it. Any help would be appreciated.

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...