How to email currency with thousand separator but not decimals

  • 12 October 2015
  • 5 replies
  • 6 views

Badge +3

SharePoint List items

Field type: currency, no decimals.  Output ex.: $1,500

 

Requirement:

Email HTML table (daily cost report) with desirable output $1,550. This is because the numbers reported are in millions.

 

Issue:

Inline function currency() displays cents/decimals. Output $1,550.00. 

Storing field as number type variable, output is missing the thousand separator (ex.: 1500).

Wasn't able to format the variables (number, text or currency types) to the desired format.

I tried using inline function with text variable (remove() and round()), but I must be doing something wrong,  it’s parsing the literal text.  I thought this would be something simple but I'm stuck.  Any help is much appreciated.  Thanks!
 
 
 
 
 
 
 
 
 
 





5 replies

Badge +6

Hi Monica,

I'm not sure if I am missing anything, but when I run a test with a SharePoint List column defined as currency and no decimals it appears to go through to the email without issue - see below:

Here I have simply put the value, as is, in the first line of the email and then again within the HTML table.

Are you only pulling this value in from the list without doing anything extra to it?

Cheers,

Mark

Badge +9

Replace decimals with empty string using regular expression:

fn-Replace(fn-Currency(yournumber), ".*$", "")

Badge +3

Hi Manfred, thanks for your reply.  I used a modified version of your answer, only because I didn't know how to enter the pattern you provided in the Regular Expression form.  Here is what I used and it worked. Thank you!

regularExpression.png

Mark, In my scenario I'm retrieving rows of information from a collection variable.

Badge +9

Hallo Monica

be carefull. Your regular expression pattern will not work als you expected. The dot in regex is a meta character. It will match any character. To realy match a dot you have to escape it with a back slash as in my regex pattern. The $ there matches end of string.

Kind regards

Manfred

Badge +9

I'm trying to set a textbox value using a formula in a calculated value via JavaScript but can't get it remove the decimals.

 

Anyone?

 

setTextBoxSubmissionEstimatedMarketValue(fn-Replace(currency(SubmissionEstimatedMarketValue), ".*$", ""))



Reply