I need to display currency $45700 as $45,700 using HTML.Can anyone please help me here how do I do it.
2 Answers
To do this in Flow, insert an action that converts your number to the format you want.
Then you use the output of this action in your email body. It will be listed in the dynamic content under "Format number".
-
Hello Rune, Thank you for your assistance. :) I tried this but it still gives me the number in the email as $2475394.00 and not as comma separated digits. is there any solution to it?– HRYCommented May 6, 2020 at 10:03
-
Try changing the format around in the format number action, it should respect the format you set there. Commented May 6, 2020 at 10:25
-
Hello Rune, thank you for your suggestion. :) It worked when I selected $1,234.00 but I had one more query what if I do not want the dollar symbol and I just want the number to be displayed as 1,234.00. I am asking this because in future I might be working with some other currency and I don't want it to be restricted to $. Now when I try to using the format 1,234.00 it gives me the value as 1234 in the email. Is there any suggestion how do I handle this?– HRYCommented May 6, 2020 at 17:26
-
1Hi Rune, it worked. :) Thank you. I used ###,###,###.00 as a custom value in the format field. :)– HRYCommented May 6, 2020 at 18:03
-
We can use the below HTML code:
<!DOCTYPE html>
<html>
<body>
<p>
Formatting 150 as US dollars (US$):
</p>
<script>
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2,
});
// for 150$
document.write(formatter.format(150));
</script>
</body>
</html>
Source:
How can I format numbers as dollars currency string in JavaScript?
-
will this work in the mail body of microsoft flow? I have to take a dynamic content where the amount is stored and want to display the amount as currency value $23,600 as mentioned above in my question– HRYCommented Apr 22, 2020 at 9:10
-
1You did not mention that it was to be used in an email body in a flow... I think the html will be fine, but not the script bit. Commented Apr 22, 2020 at 10:55