### Correct vs. Incorrect Decimal Conversion in Tests Source: https://github.com/kimplify/deci/blob/main/CLAUDE.md When testing, always use string-constructed Decimal values to avoid floating-point imprecision. This example shows the correct and incorrect ways to define expected Decimal values. ```kotlin val expected = "0.10".toDecimal() ``` ```kotlin val expected = 0.10.toDecimal() ``` -------------------------------- ### Comparisons and Helper Functions for Deci Source: https://github.com/kimplify/deci/blob/main/README.MD Illustrates comparison operators and utility methods like max, min, absolute value, and checking for negative or zero values with Deci objects. ```kotlin val x = Deci("5.5") x > Deci("3.2") → true x.max(Deci("3.2")) → 5.5 x.min(Deci("3.2")) → 3.2 Deci("-7.5").abs() → 7.5 Deci("-7.5").isNegative() → true Deci.ZERO.isZero() → true ``` -------------------------------- ### Basic Arithmetic Operations with Deci Source: https://github.com/kimplify/deci/blob/main/README.MD Demonstrates fundamental arithmetic operations like addition, subtraction, multiplication, division, modulo, and negation using the Deci class. ```kotlin val a = Deci("10.5") val b = Deci("2.3") a + b → 12.8 a - b → 8.2 a * b → 24.15 a / b → 4.565217391304347826086956521739130435 a % b → 1.3 -a → -10.5 ``` -------------------------------- ### Commit changes for sample app Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Stages and commits the modified validation screen file in the sample application. ```bash git add sample/composeApp/src/commonMain/kotlin/org/kimplify/screens/ValidationScreen.kt git commit -m "Sample app: toPlainString -> toString" ``` -------------------------------- ### Decimal Rounding with Deci Source: https://github.com/kimplify/deci/blob/main/README.MD Shows how to set the scale and apply specific rounding modes for decimal numbers using Deci. Useful for controlling precision in calculations. ```kotlin val pi = Deci("3.14159265359") pi.setScale(2, RoundingMode.HALF_UP) → 3.14 Deci("1").divide(Deci("3"), 6, RoundingMode.HALF_UP) → 0.333333 ``` -------------------------------- ### Common Gradle Commands for Deci Library Source: https://github.com/kimplify/deci/blob/main/CLAUDE.md A collection of frequently used Gradle commands for building, testing, linting, publishing, and managing API stability for the Deci library. ```bash # Build all targets ./gradlew build ``` ```bash # Run all tests across all targets ./gradlew allTests ``` ```bash # Run JVM tests only ./gradlew :core:jvmTest ``` ```bash # Lint / format check ./gradlew ktlintCheck ``` ```bash # Auto-fix lint issues ./gradlew ktlintFormat ``` ```bash # Publish to local Maven (for local integration testing) ./gradlew publishToMavenLocal ``` ```bash # Generate API binary-compatibility dump ./gradlew updateKotlinAbi ``` ```bash # Check for binary-compatibility regressions ./gradlew checkKotlinAbi ``` -------------------------------- ### Update API dump for compatibility Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Run `./gradlew apiDump` after all changes to update the `.api` file, ensuring that `toPlainString()` is correctly removed from the public API definition. ```bash ./gradlew apiDump ``` -------------------------------- ### Set up Deci Logging in Kotlin Source: https://github.com/kimplify/deci/blob/main/README.MD Shows how to configure a custom log sink for Deci to capture logging messages. A lambda function can be provided to DeciConfiguration.logSink to process log entries, identified by a tag and message. Logging can also be disabled entirely. ```kotlin DeciConfiguration.logSink = DeciLogSink { tag, message -> println("[$tag] $message") } DeciConfiguration.disableLogging() ``` -------------------------------- ### Formatting Deci Numbers Source: https://github.com/kimplify/deci/blob/main/README.MD Demonstrates various formatting options for Deci numbers, including currency, thousands separators, percentages, scientific notation, custom patterns, and converting to words. ```kotlin val price = Deci("1234567.891") price.formatCurrency() → "$1,234,567.89" price.formatWithThousandsSeparator() → "1,234,567.891" price.formatAsPercentage() → "123456789.1%" price.toScientificNotation() → "1.234567E+6" price.format("#,##0.00") → "1,234,567.89" Deci("42").toWords() → "forty two" ``` -------------------------------- ### Migrate internal call site from toPlainString() to toString() Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Migrate internal call sites that previously used `Deci.toPlainString()` to use `Deci.toString()` instead. This applies to various files including `DeciSerializer.kt`, `DeciFormatting.kt`, and `DeciValidation.kt`. ```kotlin // DeciSerializer.kt:30 // DeciFormatting.kt:37, 69, 91, 141, 143, 159, 257 // DeciValidation.kt:66, 118, 237, 246 // DeciMath.kt:155 // DeciExtensions.kt:34 // All these files call Deci.toPlainString() and must switch to toString() ``` -------------------------------- ### Configure Division Context in Kotlin Source: https://github.com/kimplify/deci/blob/main/README.MD Demonstrates how to perform division with different precision and rounding modes using DeciContext. The default context uses 20 fractional digits and HALF_UP rounding. Explicit contexts or scale and roundingMode parameters can be provided for custom behavior. ```kotlin Deci("10") / Deci("3") // DeciContext.DEFAULT Deci("10").divide(Deci("3"), DeciContext.CURRENCY_USD) // 2 digits, HALF_UP Deci("10").divide(Deci("3"), scale = 4, roundingMode = RoundingMode.HALF_EVEN) ``` -------------------------------- ### Verify API dump cleanliness Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Runs the API check task to confirm that the API dump is clean and that `toPlainString` has been successfully removed. ```bash ./gradlew apiCheck ``` -------------------------------- ### Deci Module Layout Source: https://github.com/kimplify/deci/blob/main/CLAUDE.md Illustrates the directory structure and module layout of the Deci library, highlighting the separation of common core logic from platform-specific implementations and integration modules. ```plaintext deci/ ├── core/ # Expect/actual declarations, public API surface │ ├── commonMain/ # Decimal class, arithmetic operators, rounding modes │ ├── jvmMain/ # JVM actual (backed by java.math.BigDecimal) │ ├── jsMain/ # JS actual │ ├── nativeMain/ # Native actual │ └── wasmMain/ # WASM actual (if supported) ├── serialization/ # kotlinx.serialization integration │ └── commonMain/ ├── ktor/ # Optional: Ktor content-negotiation integration └── build-logic/ # Convention plugins, shared Gradle config ``` -------------------------------- ### Build and test Deci project Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Executes the build and test tasks for all targets of the Deci project to ensure code integrity. ```bash ./gradlew build ./gradlew allTests ``` -------------------------------- ### Extension Functions for Deci Conversion and List Summation Source: https://github.com/kimplify/deci/blob/main/README.MD Demonstrates extension functions for converting primitive types (Int, Long, String) to Deci, safe conversion with null fallback, and summing a list of Deci numbers. ```kotlin 42.toDeci() 1000L.toDeci() "123.45".toDeci() "maybe".toDeciOrNull() → null listOf(Deci("1.5"), Deci("2.3"), Deci("3.7")).sumDeci() → 7.5 ``` -------------------------------- ### Commit: JVM Deci.kt changes Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Commit the changes made to the JVM `Deci.kt` file, removing `toPlainString()` and updating `toString()`. ```bash git add deci/src/jvmMain/kotlin/org/kimplify/deci/Deci.kt git commit -m "JVM: remove toPlainString, make toString use BigDecimal.toPlainString" ``` -------------------------------- ### Update sample app: Replace toPlainString with toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Replaces the `toPlainString()` comparison with `toString()` in the sample application's validation screen to align with the API changes. ```kotlin original.toString() == deserialized.toString() ``` -------------------------------- ### Advanced Mathematical Operations with Deci Source: https://github.com/kimplify/deci/blob/main/README.MD Covers advanced math functions like exponentiation (pow), square root (sqrt), rounding to the nearest multiple, and rounding to a specific number of significant digits. ```kotlin Deci("2").pow(Deci("3")) → 8 Deci("16").sqrt() → 4.0000000000 Deci("16").sqrt(precision = 2) → 4.00 Deci("1234").roundToNearest(Deci("50")) → 1250 Deci("1234.567").roundToSignificantDigits(4) → 1235 ``` -------------------------------- ### Commit Apple changes Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Stage and commit the modified Deci.kt file for the Apple platform after removing toPlainString(). ```bash git add deci/src/appleMain/kotlin/org/kimplify/deci/Deci.kt git commit -m "Apple: remove toPlainString" ``` -------------------------------- ### Using DeciContext for Precision and Rounding Source: https://github.com/kimplify/deci/blob/main/README.MD Bundles precision and rounding mode into a reusable DeciContext object for consistent decimal operations. Demonstrates default and predefined contexts. ```kotlin val ctx = DeciContext(precision = 4, roundingMode = RoundingMode.HALF_UP) Deci("10").divide(Deci("3"), ctx) → 3.3333 DeciContext.DEFAULT → 20 digits, HALF_UP DeciContext.CURRENCY_USD → 2 digits, HALF_UP DeciContext.BANKING → 2 digits, HALF_EVEN ``` -------------------------------- ### Commit Changes Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Stage and commit the modified files with a descriptive message indicating the migration of `toPlainString` calls to `toString`. ```bash git add deci/src/commonMain/kotlin/org/kimplify/deci/DeciSerializer.kt \ deci/src/commonMain/kotlin/org/kimplify/deci/formatting/DeciFormatting.kt \ deci/src/commonMain/kotlin/org/kimplify/deci/validation/DeciValidation.kt \ deci/src/commonMain/kotlin/org/kimplify/deci/math/DeciMath.kt \ deci/src/commonMain/kotlin/org/kimplify/deci/extension/DeciExtensions.kt git commit -m "Migrate all internal toPlainString calls to toString" ``` -------------------------------- ### Add Deci Dependency to Single-Platform Project Source: https://github.com/kimplify/deci/blob/main/README.MD Include the Deci library in your project dependencies for single-platform applications. ```kotlin dependencies { implementation("org.kimplify:deci:0.2.2") } ``` -------------------------------- ### Deci Constants and Safe Parsing Source: https://github.com/kimplify/deci/blob/main/README.MD Provides access to predefined Deci constants (ZERO, ONE, PI, etc.) and safe methods for parsing strings into Deci objects, handling invalid input gracefully. ```kotlin Deci.ZERO Deci.ONE Deci.TEN DeciConstants.PI DeciConstants.E DeciConstants.HALF DeciConstants.HUNDRED DeciConstants.THOUSAND DeciConstants.NEGATIVE_ONE Deci.fromStringOrNull("42.5") → Deci(42.5) Deci.fromStringOrZero("invalid") → Deci.ZERO ``` -------------------------------- ### Deci Scale and Precision Information Source: https://github.com/kimplify/deci/blob/main/README.MD Shows how to retrieve the scale (number of digits after the decimal point) and precision (total number of significant digits) of a Deci number. ```kotlin Deci("1.50").scale() → 2 Deci("1.50").precision() → 3 ``` -------------------------------- ### Commit: Android Deci.kt changes Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Commit the changes made to the Android `Deci.kt` file, removing `toPlainString()` and updating `toString()`. ```bash git add deci/src/androidMain/kotlin/org/kimplify/deci/Deci.kt git commit -m "Android: remove toPlainString, make toString use BigDecimal.toPlainString" ``` -------------------------------- ### Update Sample App ValidationScreen KDoc Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Update `ValidationScreen.kt` in the sample app by changing two instances of `.toPlainString()` calls to `.toString()` to reflect the unified string representation. ```kotlin // ValidationScreen.kt:284 - two .toPlainString() calls -> .toString() ``` -------------------------------- ### Update DeciPropertyTest.kt: Replace toPlainString with toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Replaces `a.toPlainString()` with `a.toString()` in `DeciPropertyTest.kt` to ensure the correct string representation is used when creating a copy of a Deci object. ```kotlin val copy = Deci(a.toString()) ``` -------------------------------- ### Update DeciPropertyTest KDoc Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Update `DeciPropertyTest.kt` by changing the call from `a.toPlainString()` to `a.toString()` to align with the unified string representation method. ```kotlin assertEquals(expected, a.toString()) // a.toPlainString() -> a.toString() ``` -------------------------------- ### Update DeciExtensions: Replace toPlainString with toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md In `DeciExtensions.kt`, update the line `val str = truncated.toPlainString()` to `val str = truncated.toString()` for consistent string representation. ```kotlin val str = truncated.toString() ``` -------------------------------- ### Update DeciSerializationTest KDoc Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Update `DeciSerializationTest.kt` by changing the call from `restored.toPlainString()` to `restored.toString()` to use the new standard string representation method. ```kotlin assertEquals(expected, restored.toString()) // restored.toPlainString() -> restored.toString() ``` -------------------------------- ### Update DeciSerializationTest.kt: Replace toPlainString with toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Updates the assertion in `DeciSerializationTest.kt` to compare the restored Deci object's string representation using `toString()` instead of `toPlainString()`. ```kotlin assertEquals(s, restored.toString(), "String representation changed for $s") ``` -------------------------------- ### Commit wasmJs changes Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Stage and commit the modified Deci.kt file for the wasmJs platform after removing toPlainString() and fixing toString(). ```bash git add deci/src/wasmJsMain/kotlin/org/kimplify/deci/Deci.kt git commit -m "wasmJs: remove toPlainString, fix toString to never use scientific notation" ``` -------------------------------- ### Update test case for toPlainString() to toString() Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Update a specific test case in `DeciTest.kt` by changing the call from `d.toPlainString()` to `d.toString()` to reflect the API change. ```kotlin assertEquals(expected, d.toString()) // d.toPlainString() -> d.toString() ``` -------------------------------- ### Commit: JS Deci.kt changes Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Commit the changes made to the JS `Deci.kt` file, removing `toPlainString()` and fixing `toString()` to prevent scientific notation. ```bash git add deci/src/jsMain/kotlin/org/kimplify/deci/Deci.kt git commit -m "JS: remove toPlainString, fix toString to never use scientific notation" ``` -------------------------------- ### Add Deci Dependency to Kotlin Multiplatform Project Source: https://github.com/kimplify/deci/blob/main/README.MD Include the Deci library in your commonMain dependencies for Kotlin Multiplatform projects. ```kotlin kotlin { sourceSets { commonMain.dependencies { implementation("org.kimplify:deci:0.2.2") } } } ``` -------------------------------- ### Serialization of Deci with kotlinx.serialization Source: https://github.com/kimplify/deci/blob/main/README.MD Shows how to serialize and deserialize data classes containing Deci objects using kotlinx.serialization. Deci values are serialized as JSON strings to maintain precision. ```kotlin @Serializable data class Price(val amount: Deci, val currency: String) Json.encodeToString(Price(Deci("99.99"), "USD")) → {"amount":"99.99","currency":"USD"} ``` -------------------------------- ### Update DeciMath: Replace toPlainString with toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md In `DeciMath.kt`, replace the assignment `val str = absValue.toPlainString()` with `val str = absValue.toString()` to use the standard string conversion. ```kotlin val str = absValue.toString() ``` -------------------------------- ### Replace toString and toPlainString in wasmJs Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Replace the existing `toString` and `toPlainString` methods with a new `toString` implementation that handles scaling and avoids scientific notation. This ensures consistent decimal formatting. ```kotlin actual override fun toString(): String { val scale = _scale ?: return internal.toString() if (scale <= 0) return internal.toString() return internal.toFixed(scale) } actual fun toPlainString(): String { val scale = _scale return if (scale != null) internal.toFixed(scale) else internal.toFixed() } ``` ```kotlin actual override fun toString(): String { val scale = _scale return if (scale != null && scale > 0) internal.toFixed(scale) else internal.toFixed() } ``` -------------------------------- ### Update DeciTest.kt: Replace toPlainString with toString in roundtrip test Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Replaces the `toPlainString()` call with `toString()` in the `toDouble and toString roundtrip for simple values` test to ensure consistency. ```kotlin @Test fun `toDouble and toString roundtrip for simple values`() { listOf("0", "1.5", "-2.75").forEach { s -> val d = Deci(s) assertEquals(s, d.toString()) assertEquals(s.toDouble(), d.toDouble()) } } ``` -------------------------------- ### Update DeciBulkOperationsTest KDoc Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Update `DeciBulkOperationsTest.kt` by changing the call from `result[0].toPlainString()` to `result[0].toString()` to use the unified string representation method. ```kotlin assertEquals(expected, result[0].toString()) // result[0].toPlainString() -> result[0].toString() ``` -------------------------------- ### Commit API dump changes Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Stages and commits the updated API dump files after verifying the removal of `toPlainString`. ```bash git add deci/api/ git commit -m "Update API dump: remove toPlainString from public API" ``` -------------------------------- ### Update Deci.kt expect declaration and toString KDoc Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Modify the expect declaration in `Deci.kt` to remove `toPlainString()` and update the KDoc for `toString()` to clarify its behavior regarding scientific notation and scale preservation. ```kotlin /** * Returns the string representation of this [Deci] without scientific notation, * preserving the scale (e.g. "1.50" stays "1.50"). * * This method never uses exponential notation regardless of the value's magnitude. */ override fun toString(): String ``` -------------------------------- ### Update JVM Deci.kt: Remove toPlainString, fix toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md On the JVM, remove the `toPlainString()` actual function and update the `toString()` actual function to delegate to `internal.toPlainString()` from `BigDecimal`. ```kotlin actual override fun toString(): String = internal.toPlainString() ``` -------------------------------- ### Change JVM/Android toString() implementation Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md On JVM and Android, change the `toString()` implementation to use `internal.toPlainString()` from BigDecimal to ensure it never uses scientific notation. ```kotlin override fun toString(): String = internal.toPlainString() ``` -------------------------------- ### Update DeciSerializer: Replace toPlainString with toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md In `DeciSerializer.kt`, replace the call to `encoder.encodeString(value.toPlainString())` with `encoder.encodeString(value.toString())`. Also, update the class KDoc to reflect the change in serialization behavior. ```kotlin encoder.encodeString(value.toString()) ``` ```kotlin * For example, `Deci("1.50")` is serialized as the JSON string `"1.50"`, not the * JSON number `1.5`. * * Serialization uses [Deci.toString], which never produces scientific notation. * Deserialization parses the decoded string via the [Deci] string constructor. ``` -------------------------------- ### Update DeciFormatting: Replace toPlainString with toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md In `DeciFormatting.kt`, replace all instances of `.toPlainString()` with `.toString()`. This affects string formatting and absolute value representations. ```kotlin val str = this.toString() ``` ```kotlin return "${rounded.toString()}$symbol" ``` ```kotlin val str = this.abs().toString() ``` ```kotlin "0.00" -> this.setScale(2, RoundingMode.HALF_UP).toString() ``` ```kotlin "0.0000" -> this.setScale(4, RoundingMode.HALF_UP).toString() ``` ```kotlin val parts = abs.toString().split(".") ``` ```kotlin val str = this.toString() ``` -------------------------------- ### Commit changes for Deci tests Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Stages and commits the modified test files in the Deci project. ```bash git add deci/src/commonTest/kotlin/org/kimplify/deci/DeciTest.kt \ deci/src/commonTest/kotlin/org/kimplify/deci/DeciPropertyTest.kt \ deci/src/commonTest/kotlin/org/kimplify/deci/DeciSerializationTest.kt \ deci/src/commonTest/kotlin/org/kimplify/deci/math/DeciMathExtendedTest.kt \ deci/src/commonTest/kotlin/org/kimplify/deci/bulk/DeciBulkOperationsTest.kt git commit -m "Update all tests: toPlainString -> toString, fix trailing zeros assertion" ``` -------------------------------- ### Update DeciMathExtendedTest KDoc Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Update `DeciMathExtendedTest.kt` by changing the call from `result.toPlainString()` to `result.toString()` to adopt the unified string representation. ```kotlin assertEquals(expected, result.toString()) // result.toPlainString() -> result.toString() ``` -------------------------------- ### Remove toPlainString in Apple actual Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Remove the `toPlainString()` method from the Apple actual implementation. This method is redundant and its functionality is handled elsewhere. ```kotlin actual fun toPlainString(): String { val str = internal.stringValue val scale = _scale ?: return str if (scale == 0) return str.split(".")[0] val parts = str.split(".") val intPart = parts[0] val fracPart = if (parts.size > 1) parts[1] else "" return "$intPart.${fracPart.padEnd(scale, '0')}" } ``` -------------------------------- ### Update DeciBulkOperationsTest.kt: Replace toPlainString with toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Updates the assertion in `DeciBulkOperationsTest.kt` to use `toString()` for checking the length of the string representation of the first element in the result. ```kotlin assertTrue(result[0].toString().length > 5) ``` -------------------------------- ### Remove toPlainString() from JVM/Android actual implementation Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Remove the `actual fun toPlainString()` from the JVM and Android platform-specific implementations as it is no longer needed. ```kotlin // Remove actual fun toPlainString() ``` -------------------------------- ### Commit: Remove toPlainString from expect declaration Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Commit the changes made to the `Deci.kt` expect declaration and `toString()` KDoc. ```bash git add deci/src/commonMain/kotlin/org/kimplify/deci/Deci.kt git commit -m "Remove toPlainString from expect declaration, update toString KDoc" ``` -------------------------------- ### Update JS Deci.kt: Remove toPlainString, fix toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md On JS, remove the `toPlainString()` actual function and update the `toString()` actual function to use `toFixed()` to ensure it never uses scientific notation, handling cases with and without a specified scale. ```kotlin actual override fun toString(): String { val scale = _scale return if (scale != null && scale > 0) internal.toFixed(scale) else internal.toFixed() } ``` -------------------------------- ### Update toString() KDoc Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Update the KDoc for `toString()` to remove the caveat about scientific notation and state that it always returns a plain decimal form, preserving scale. ```kotlin /** * Returns the plain decimal string representation of this Deci value, preserving scale. * This method never uses scientific notation. */ ``` -------------------------------- ### Update DeciTest.kt: Rename scientific notation test Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Renames the `toPlainString never uses scientific notation` test to `toString never uses scientific notation` and updates the assertions to use `toString()`. ```kotlin @Test fun `toString never uses scientific notation`() { assertEquals("100000000000000000000", Deci("100000000000000000000").toString()) assertEquals("0.000000001", Deci("0.000000001").toString()) } ``` -------------------------------- ### Update DeciValidation: Replace toPlainString with toString Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md In `DeciValidation.kt`, replace all occurrences of `.toPlainString()` with `.toString()`. This is applied to string representations used in validation messages. ```kotlin val str = this.toString() ``` ```kotlin val str = this.toString() ``` ```kotlin "Value must be at least ${min.toString()}" ``` ```kotlin "Value must be at most ${max.toString()}" ``` -------------------------------- ### Update DeciSerializer KDoc Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Update the KDoc for `DeciSerializer` to remove references to `toPlainString()` and state that `toString()` is used for serialization. ```kotlin // DeciSerializer.kt KDoc - remove toPlainString reference, say toString() is used ``` -------------------------------- ### Update test assertion for trailing zeros Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Update test assertions to verify that `toString()` now preserves trailing zeros, as demonstrated by `Deci("1.2300").toString()` equaling `"1.2300"`. ```kotlin assertEquals("1.2300", Deci("1.2300").toString()) ``` -------------------------------- ### Rename test for scientific notation Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Rename the test case that previously checked for potential scientific notation in `toString()` to reflect its new behavior: 'toString never uses scientific notation'. ```kotlin "toString never uses scientific notation" ``` -------------------------------- ### Remove toPlainString() from expect declaration Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Remove the `toPlainString()` function from the `expect` declaration in `commonMain/Deci.kt` to eliminate it from the common API. ```kotlin // Remove fun toPlainString(): String ``` -------------------------------- ### Update DeciTest.kt: Adjust trailing zeros test assertion Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/plans/2026-03-27-remove-toplainstring.md Modifies the `trailing zeros are preserved by constructor` test to assert that `toString()` preserves trailing zeros, aligning with the change from `toPlainString()`. ```kotlin @Test fun `trailing zeros are preserved by constructor`() { assertEquals("1.2300", Deci("1.2300").toString()) } ``` -------------------------------- ### Delete test for scientific notation Source: https://github.com/kimplify/deci/blob/main/docs/superpowers/specs/2026-03-27-remove-toplainstring-design.md Delete the test case that specifically checked if `toString()` might use scientific notation, as this behavior is now guaranteed not to occur. ```kotlin // Delete "toString may use scientific notation" test ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.