Updated on 2026-08-14
This commit is contained in:
parent
3183f5b955
commit
7ca9946f47
53 changed files with 355 additions and 462 deletions
|
|
@ -370,4 +370,38 @@ internal class BigDecimalCryptoFormatTest {
|
|||
Truth.assertThat(formatted)
|
||||
.isEqualTo("0.13".addSymbolWithSpaceLeft(symbol))
|
||||
}
|
||||
|
||||
// === anyDecimals() ===
|
||||
|
||||
@Test
|
||||
fun `anyDecimals smoke`() {
|
||||
val testValue = BigDecimal("0.123412341234")
|
||||
|
||||
val formatted = testValue.format {
|
||||
crypto(
|
||||
symbol = symbol,
|
||||
decimals = 5,
|
||||
locale = testLocale,
|
||||
).anyDecimals()
|
||||
}
|
||||
|
||||
Truth.assertThat(formatted)
|
||||
.isEqualTo("0.12341".addSymbolWithSpaceLeft(symbol))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `anyDecimals zero`() {
|
||||
val testValue = BigDecimal("0.123412341234")
|
||||
|
||||
val formatted = testValue.format {
|
||||
crypto(
|
||||
symbol = symbol,
|
||||
decimals = 0,
|
||||
locale = testLocale,
|
||||
).anyDecimals()
|
||||
}
|
||||
|
||||
Truth.assertThat(formatted)
|
||||
.isEqualTo("0".addSymbolWithSpaceLeft(symbol))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue