"%.#f".format function return value with "comma" separator, I need it with "dot" separator


#1

Hi Kotlin community.

I am using “%.#”.format(number) to use only # decimal numbers to avoid display all decimal values, but this function returns with “comma” separator and I need this values with “dot” separator.

I have to use another function or I have to use a dependency to get the result.

Thanks


#2

You probably want one of the overloads with a Locale parameter: format

Use Locale.ENGLISH or Locale.ROOT.


#3

Thanks @jstuyts. This resource help me in the issue.

Have a good day

Keep coding.