mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
Merge remote-tracking branch 'origin/v6-dev' into v6-dev
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package org.dromara.hutool.core.math;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
|
||||
public class Issue3423Test {
|
||||
@Test
|
||||
public void toBigDecimalOfNaNTest() {
|
||||
final BigDecimal naN = NumberUtil.toBigDecimal("NaN");
|
||||
Assertions.assertEquals(BigDecimal.ZERO, naN);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void toBigDecimalOfNaNTest2() throws ParseException {
|
||||
final NumberFormat format = NumberFormat.getInstance();
|
||||
((DecimalFormat) format).setParseBigDecimal(true);
|
||||
final Number naN = format.parse("NaN");
|
||||
Console.log(naN.getClass());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user