Anyone can help me for `actual` implementation in ...
# multiplatform
a
Anyone can help me for
actual
implementation in iOS
Copy code
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
I’m not iOS developer, I’m stuck with formatting kind of thing
x
for kotlin parameter labels use
=
Copy code
return String(format = "%.2f", this)