Skip to content

Commit 6c5180d

Browse files
committed
Merge branch 'master' into fix-constant-two
2 parents a27ced0 + 5bb1cc3 commit 6c5180d

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ build/
1111
gradle.properties
1212
/buildSrc/out
1313
/bignum/node_modules
14+
/bignum/package.json

bignum/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "kotlin-multiplatform-bignum-js",
3+
"version" : "0.0.1",
4+
"description" : "Kotlin Multiplatform BigNum",
5+
"main" : "flow.js",
6+
"author": "Ugljesa Jovanovic",
7+
"license": "Apache 2.0",
8+
"homepage": "",
9+
"dependencies": {
10+
"kotlin" : "1.3.20"
11+
},
12+
"devDependencies": {
13+
"mocha": "5.2.0"
14+
}
15+
}

bignum/src/commonMain/kotlin/com/ionspin/kotlin/bignum/decimal/BigDecimal.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class BigDecimal private constructor(
5959
val ONE = BigDecimal(BigInteger.ONE)
6060
val TWO = BigDecimal(BigInteger.TWO)
6161

62+
var useToStringExpanded : Boolean = false
63+
6264

6365
private fun roundOrDont(significand: BigInteger, exponent: BigInteger, decimalMode: DecimalMode): BigDecimal {
6466
return if (decimalMode.decimalPrecision != 0L && decimalMode.roundingMode != RoundingMode.NONE) {
@@ -1357,6 +1359,9 @@ class BigDecimal private constructor(
13571359
* i.e. 1.23E+9
13581360
*/
13591361
override fun toString(): String {
1362+
if (BigDecimal.useToStringExpanded) {
1363+
return toStringExpanded()
1364+
}
13601365
val significandString = significand.toString(10)
13611366
val modifier = if (significand < 0) {
13621367
2

0 commit comments

Comments
 (0)