From 47c1f2db5a95ec1cc9cbad5bb446f56c08b3dbf1 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Tue, 7 Feb 2023 18:19:03 -0600 Subject: [PATCH] update bindings-bigdecimal to work with J17 enums --- nbr/src/main/resources/examples/bindings-bigdecimal.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nbr/src/main/resources/examples/bindings-bigdecimal.yaml b/nbr/src/main/resources/examples/bindings-bigdecimal.yaml index 2d05000b9..47f388678 100644 --- a/nbr/src/main/resources/examples/bindings-bigdecimal.yaml +++ b/nbr/src/main/resources/examples/bindings-bigdecimal.yaml @@ -10,13 +10,16 @@ scenarios: # a scale parameter or a custom MathContext, but not both. The scale parameter # is not supported for String or Double input forms. +# As of Java 17, the roundingMode enums are UP DOWN CEILING FLOOR HALF_UP HALF_DOWN HALF_EVEN UNNECESSARY +# and the precision must be zero or greater + bindings: # convert an example double with some fractional values, then convert it to BigDecimal from_double: ToDouble(); Div(100.0d); ToBigDecimal(); # convert doubles to BigDecimal, with custom precision and rounding - from_double_custom5: ToDouble(); Div(100.0d); ToBigDecimal('precision=5 roundingMode=HALF'); + from_double_custom5: ToDouble(); Div(100.0d); ToBigDecimal('precision=5 roundingMode=HALF_EVEN'); # convert directly to BigDecimal from long as whole numbers from_long: ToBigDecimal();