Skip to content

Commit e3b38cc

Browse files
committed
ポンドをキログラムに変換しました。
1 parent 196521f commit e3b38cc

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
x=P2?数(1)
2+
SF:ポンド|"lb"
3+
SF?キログラム|"kg"|"kg"
4+
5+
kg = x * 0.45359237
6+
format(kg, 5)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package xyz.javecs.tools.text2expr.test.kotlin.rules.weight
2+
3+
import org.junit.Test
4+
import xyz.javecs.tools.text2expr.Text2Expr
5+
import kotlin.test.assertEquals
6+
7+
class WeightTest {
8+
9+
val text2Expr = Text2Expr()
10+
11+
@Test fun poundToKilogram1() {
12+
assertEquals("0.45359", text2Expr.eval("1ポンドは、なんキログラム?"))
13+
assertEquals("0.45359", text2Expr.eval("ポンドは、なんキログラム?"))
14+
assertEquals("0.45359", text2Expr.eval("1lbは、なんkg?"))
15+
assertEquals("0.45359", text2Expr.eval("1lbをkgにしたら"))
16+
assertEquals("0.45359", text2Expr.eval("1ポンド?"))
17+
}
18+
19+
}

0 commit comments

Comments
 (0)