ehigginbotham Posted November 15, 2016 Share Posted November 15, 2016 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. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted November 16, 2016 Share Posted November 16, 2016 var s = Field("LASTGIFT"); var Number = StringToNumber(s.replace(/\,/g, "")); if (Number < 20) return 40; //else return FormatNumber("#,###.00", Number * 1.5); 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.