package utils
import platform.Foundation.StringStyle
internal actual fun Double.formatWithDecimalPlaces(places: Int): String {
return String(format: "%.2f", this)
}
But it has several errors:
e: …/shared/src/iosMain/kotlin/utils/DoubleExtensions.kt: (6, 25): Expecting ‘)’
e: …/shared/src/iosMain/kotlin/utils/DoubleExtensions.kt: (6, 27): Unexpected tokens (use ‘;’ to separate expressions on the same line)
e: …/shared/src/iosMain/kotlin/utils/DoubleExtensions.kt: (3, 28): Unresolved reference: StringStyle
e: …/shared/src/iosMain/kotlin/utils/DoubleExtensions.kt: (6, 12): Using ‘String(CharArray): String’ is an error. Use CharArray.concatToString() instead
e: …/shared/src/iosMain/kotlin/utils/DoubleExtensions.kt: (6, 19): Unresolved reference: format
An Tran
08/09/2022, 4:31 AM
I’m not iOS developer, I’m stuck with formatting kind of thing