Value formatters - numeric not working

Hi!

I am trying to format input into a currency format ($xxx.xx).

I receive the numerical value which is often calculated (eg 1.65348653) and wish to round this.

I have tried following the guidance here but so far been unsuccessful:
https://plumsail.com/docs/documents/v1.x/document-generation/common-docx-xlsx/formatters.html

The date formatting works fine, and is currently implemented, but so far none of the numeric values work.

I have tried an array of possible methods which have all not worked:

{{Total Package Funds:format(N2)}}
{{Total Package Funds}:format(P)}
{{Total Package Funds}:format(C)}
{{Total Package Funds}:format(ā€œCā€,en-US)}
{{ Total Package Funds }:format(C0)}

I've tried passing data as both a value from SharePoint, or hardcoding a number into the output template data.

image

The output continues to be unrounded:

image

I've also looked here and tried to guess the formatting, but this hasn't worked.

I've also tried adjusting the "token type" but I believe this might just be for autogenerating forms.

Interestingly, using something like {Total Package Funds}.Length} returns the number of characters, so it seems to be able to handle the number as a "string". I'm unsure how to get it to treat the input as a numerical type (and thus allow it to be formatted).

Thanks!

Hello @lucast,

I tried this value formatter

image

and this flow

image

it worked and gave me this result

image

Probably your input is not a number but a string.

Best Regards,
Petr Bushuev
Plumsail team

1 Like

Thanks Petr,

My mistake- it was just the quotes (my mistake!)

Numeric columns now pass nicely into Plumsail!

One issue which added some confusion was that "Look up" values in SharePoint come through as "strings" regardless if they are wrapped in quotes or not.

It's more of a SharePoint issue, but may as well ask- do you know how to pass "Lookup values" from Sharepoint to Plumsail as numeric types?

Currently I have to use Data Operations and "Compose" to create a variable, and convert it from string to float which is fairly tedious.

Thanks again for the help!

Hello @lucast,

You can probably find some solution on Micrsooft Power Automate forum. I found this one after some search.

Best Regards,
Petr Bushuev
Plumsail team

Thanks Petr, much appreciated!

That's basically what I've set up (but becomes problematic for ~20 variables).

Still works though!

Thanks again for your help resolving this!

1 Like