3

I have a code that formats a string to a big float:

formattedAmount := strconv.FormatFloat(amount, 'f', 2, 64)

The result of this is a float with precission of 2 after the comma, IE:

10000000000000.99

Now, i wish to parse this number to a currency format, as this:

10.000.000.000.000,99

Is there a way to parse the float as a string with that format in native golang?

Thanks in advance.

Rohr Facu
  • 607
  • 1
  • 12
  • 29
  • 1
    Possible duplicate: [How to fmt.Printf an integer with thousands comma](https://stackoverflow.com/questions/13020308/how-to-fmt-printf-an-integer-with-thousands-comma) – icza Apr 04 '19 at 22:27
  • The fmt package does not support thousands separators. As pointed in the comment above, this question has already been asked. Not sure what you're trying to do, but if it's a web app, your frontend should be able to handle the presentation side of things. Please refer to the link provided by @icza and you'll find enough information about this subject in referred the post. – Jose Bagatelli Apr 05 '19 at 07:55
  • 1
    Possible duplicate of [How to fmt.Printf an integer with thousands comma](https://stackoverflow.com/questions/13020308/how-to-fmt-printf-an-integer-with-thousands-comma) – Jose Bagatelli Apr 05 '19 at 07:55

0 Answers0