Create a Decimal128 from a long value. @param value the long value to convert @param scale the number of decimal places @return a new Decimal128 representing the long value @throws NumericException if scale is invalid
(long value, int scale)
| 402 | * @throws NumericException if scale is invalid |
| 403 | */ |
| 404 | public static Decimal128 fromLong(long value, int scale) { |
| 405 | validateScale(scale); |
| 406 | long h = value < 0 ? -1L : 0L; |
| 407 | return new Decimal128(h, value, scale); |
| 408 | } |
| 409 | |
| 410 | /** |
| 411 | * Extracts the digit at a specific power-of-ten position from a 128-bit decimal number. |