mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-20 11:08:31 +00:00
Always use US locale when logging rounded numbers.
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
|
||||
package org.signal.core.util
|
||||
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* Rounds a number to the specified number of places. e.g.
|
||||
*
|
||||
@@ -12,5 +14,5 @@ package org.signal.core.util
|
||||
* 1.123456f.roundedString(5) = 1.12346
|
||||
*/
|
||||
fun Double.roundedString(places: Int): String {
|
||||
return String.format("%.${places}f", this)
|
||||
return String.format(Locale.US, "%.${places}f", this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user