diff --git a/core/src/main/java/com/tngtech/valueprovider/AbstractValueProvider.java b/core/src/main/java/com/tngtech/valueprovider/AbstractValueProvider.java index c87bf94..0c2308f 100644 --- a/core/src/main/java/com/tngtech/valueprovider/AbstractValueProvider.java +++ b/core/src/main/java/com/tngtech/valueprovider/AbstractValueProvider.java @@ -560,6 +560,22 @@ public BigDecimal bigDecimalNumberWithScale(BigDecimal min, BigDecimal max, int return result.setScale(scale, RoundingMode.HALF_EVEN); } + /** + * Generates a {@link BigDecimal} in [{@code 0} ; {@code 1}], + *
+ * Example: + *
+ * ValueProvider vp = ValueProviderFactory.createRandomValueProvider(); + * vp.bigDecimalPercentage(); + *+ * + * + * @return the generated percentage. + */ + public BigDecimal bigDecimalPercentage() { + return bigDecimalNumber(BigDecimal.ZERO, BigDecimal.ONE); + } + /** * Returns the reference {@link LocalDateTime} as passed in the {@link ValueProviderInitialization}. *
Note:
diff --git a/core/src/test/java/com/tngtech/valueprovider/ValueProviderTest.java b/core/src/test/java/com/tngtech/valueprovider/ValueProviderTest.java
index 831c7d7..8af20e7 100644
--- a/core/src/test/java/com/tngtech/valueprovider/ValueProviderTest.java
+++ b/core/src/test/java/com/tngtech/valueprovider/ValueProviderTest.java
@@ -118,6 +118,7 @@ private static Collection