An Tran
08/09/2022, 4:29 AMactual
implementation in iOS
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: formatAn Tran
08/09/2022, 4:31 AMxxfast
08/09/2022, 4:44 AM=
return String(format = "%.2f", this)