Converts decimal text to BigDecimal, keeping the precision written
All 4 scenarios hold
Scale is the number of digits after the decimal point — negative when scientific notation places the value's precision above the point.
expected outcome
broken scenario
| Scenario | Input value | Parameter type? | BigDecimal as plain number? | BigDecimal scale? |
|---|---|---|---|---|
| Plain decimal | 3.14159 | java.math.BigDecimal | 3.14159 | 5 |
| Leading zero | 0.1 | java.math.BigDecimal | 0.1 | 1 |
| Scientific notation | 1.23e4 | java.math.BigDecimal | 12300 | -2 |
| No decimal point | 123 | java.math.BigDecimal | 123 | 0 |