Hi all, it's surely a stupid question, but i have the following issue:
i get amounts in string format (e.g. 4,00€ - four euro). in converting it into a number i use the float() function. However, it seems like float() recognizes the comma as the hundreds separator, and thus transforms it into 400.
Is there a way to fix it keeping my locale?
Thank you and best regards,
Vittorio
Solved! Go to Solution.
Hi again @Pstork1 and thank you for your suggestion.
I was actually trying to solve it through the very same formatnumber() you mention, however as you pointed out not only it requires a numeric input, which i solved with exactly the same combination float()+replace() that you mention, but also it returns a string! and i'd be forced to go again with float() that would again complain of the ',' 🙂
However, in trying to solve the technical issue, i lost track of the goal, that is, to provide a sharepoint document set column with a float number. this means that it does not matter how the float arrives localized in the column, as the output of the column will be localized according to the site's settings!
I've therefore solved it with
What is the Locale setting for your Power Automate environment? YOu can find that in the Power Automate settings under the Gear menu
Hi @Pstork1 ,
thank you for your prompt reply.
I have noticed it, and before writing the post i've switched it from US/english to Italian. However, it gives the same result (i've tried now again and before posting here earlier on).
I was hoping there was a sort of refresh time to wait, but it seems not the case...
There may not be a refresh time, but the setting may get embedded in the flow or the connections when they are created. Try creating a new flow and converting the value. Also is this a column from a SharePoint list? If so, then it may be picking up locale from there also.
One last thought. There is also a Format Number action available in Power Automate. With that you can control the region used for the formatting. The problem is that requires a numeric input. So you may have to do something like the following.
formatnumber(float(replace("66,76",',','.')),'##,##',locale)
Hi again @Pstork1 and thank you for your suggestion.
I was actually trying to solve it through the very same formatnumber() you mention, however as you pointed out not only it requires a numeric input, which i solved with exactly the same combination float()+replace() that you mention, but also it returns a string! and i'd be forced to go again with float() that would again complain of the ',' 🙂
However, in trying to solve the technical issue, i lost track of the goal, that is, to provide a sharepoint document set column with a float number. this means that it does not matter how the float arrives localized in the column, as the output of the column will be localized according to the site's settings!
I've therefore solved it with
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
88 | |
57 | |
42 | |
37 | |
33 |
User | Count |
---|---|
86 | |
71 | |
61 | |
56 | |
40 |