encodeBigDecimalNative

internal expect fun encodeBigDecimalNative(encoder: Encoder, value: BigDecimal)

The literal to write, which is where the platforms differ: one holds digits, the other holds a number.

internal actual fun encodeBigDecimalNative(encoder: Encoder, value: BigDecimal)

The JS BigDecimal already holds the text, so there is nothing to format on the way out.

internal actual fun encodeBigDecimalNative(encoder: Encoder, value: BigDecimal)

toPlainString and not toString: the latter switches to scientific notation once the exponent is far enough from the scale, and 1.0E+10 is not a JSON number.