We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef868f1 commit 1184c08Copy full SHA for 1184c08
sample/mpp-library/src/commonMain/kotlin/com/icerockdev/library/Calculator.kt
@@ -12,13 +12,13 @@ class Calculator {
12
val engine = JavaScriptEngine()
13
val testScript = "a+b"
14
15
- val intA = a.toIntOrNull()
16
- val intB = b.toIntOrNull()
+ val numberA = a.toDoubleOrNull()
+ val numberB = b.toDoubleOrNull()
17
18
- val context = if (intA != null && intB != null) {
+ val context = if (numberA != null && numberB != null) {
19
mapOf(
20
- "a" to JsType.IntNum(intA),
21
- "b" to JsType.IntNum(intB)
+ "a" to JsType.DoubleNum(numberA),
+ "b" to JsType.DoubleNum(numberB)
22
)
23
} else {
24
0 commit comments