cancel
Showing results for 
Search instead for 
Did you mean: 

Currency and decimal format in Microsoft Flows

I am building an email output where I am retreiving currency, ie formatted as currency in SharePoint.  It would be good to be able to format the "float" to 2 decimal places using workflow definition language.  I have been able to use substring but it fails when the number from the SharePoint list is 0.  It appears that 0 is actually represented as 0.0 and not presenting a second decimal place as integer numbers do.

Status: Under Review

Thanks for the input, we will evaluate this for a future release.

Comments
Advocate V

I posted a temporary solution to round and format a float for currency.

 

We really, really, really need some number formatting.

Advocate V

I am wondering why this idea has not a very, very high voting. Perhaps most of the user come from USA. In Germany, it is a pain in the ass to have to convert every single number (decimal point, round numbers, currency, etc.) output. 😞

 

And I am still wondering, why there is no simple function to round floats. There is a splitt, but nothing to mathematically round numbers.

Advocate II

I strongly agree. Lack of robust & simple approach to rounding and number formatting is one of the most significant negatives about Flow so far. Currency, %, and common abbreviations (M, MM, k etc.) should be standard rather than requiring torturous workarounds.

 

Regular Visitor

Very badly needed...There are only a handful of data types available for Flow expressions, which adds a lot of complexity to what should be simple flows to populate Word templates.  The currency data type is available in VBA, so not sure why it isn't integrated within the WDL? 

 

Even Adobe DC's JS console allows me to create a simple for each loop to automatically populate fields with different data types set. In contrast, Word requires the field data type to be Text if using the Word Online connector in Flow. Basically a middleware issue because an SP list has the correct data type and Word has the same data type functionality as SP, yet Flow pulls and outputs as text.

Advocate I

Serious Issue

I'm producing PDF documenst with Flow, that show currency values. The values been used could have no decimal place or have 1 or 2. But I always need to show 2 decimal places, so that the form looks correct and professional and is readable.

 

Some of my data comes thorugh PowerQuery in flow ( SQL), but transform in flow does not seem to let you pad out to 2 decimal places, so if my value is 1.3, I want to see 1.30, if it's 1.33 it just shows 1.33

 

Some of the links here, don't work, as they round down to decimal places.

Plus I have 10-12 values like this, creating varaibles, compose actions and referencing them all is a lot of work for the lack of expression to do this, plus then there's the thousand sperators.... Smiley Frustrated

Advocate V

@bkeano Your solution is in my posted referenced above.

  • rounding, not truncating
  • padding zeroes if needed
  • adding thousands separator
  • works for numbers up to 1 trillion

Good luck!

Regular Visitor

Hi @bkeano,

 

You can use Plumsail Documents to generate your PDFs. Please review the example of PDF generation from the DOCX template. In the DOCX template, you can use format formatter to change the representation of numbers and currencies.

 

Note: Plumsail Documents is a third party paid connector.

Advocate I


thanks @degvalentine 

The above sorted for me, had to write a number of compose actions, make the expressions, then test a number of times, worked perfect! Smiley Happy

My flow has lots of levels and the values I wanted to format are all over the place, so just a pity need to spend 2 hours composing new actions to get thousand seperators and correctly formatted numbers where really a simple build in expression would do the jobSmiley Sad

 

Happy for now! 

Regular Visitor

Yes in the workflow definition language there should be function like formatNumber similar to the formatDateTime function that already exists. I can't believe there is no function to format a number.

Advocate V

@Stephen 

We are still waiting for this:

In countries which use comma as decimal place, it is still a pain in the ass to have to convert every single number (decimal point dot to comma, round numbers, currency, etc.) in an output. 

 

The workarounds are very, very big expressions. I also still wondering, why there is not a simple function to round floats to as specific amount of decimal places. There is a split, but nothing to mathematically round numbers. Also something to set globally (or at least in Flow Config, or at very least in Config for a email-Connector itself or at very, very least with much simpler expressions!) decimal point, "position after decimal point", rounding floats(!) are needed. 


When you have lots of data, putting these in emails and need to do heavy expressions for every single value, it's really not funny.

Please give us simple features for formatting floats in any outputs!