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

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.


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

Use Locale.ENGLISH or Locale.ROOT.

1 Like

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

Have a good day

Keep coding.