You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a problem with handling @DecimalMin / @DecimalMax as it is not generating fractional part of decimal. I think it is connected with not supporting @Digits, but you should know about it anyway :)
Example:
public class TestDecimal {
@DecimalMax("1.00")
@DecimalMin("0.01")
private BigDecimal bigDecimal;
public BigDecimal getBigDecimal() {
return bigDecimal;
}
public void setBigDecimal(BigDecimal bigDecimal) {
this.bigDecimal = bigDecimal;
}
}
It is always returning "0", which is invalid value for this case.
Best regards,
Redid
The text was updated successfully, but these errors were encountered:
Random BigDecimal generation was based on long instead of double.
When specifying a min as 0.01, a min of 0 was used.
This commit fixes the issue by using the double type to avoid any data
precision loss.
This issue was deeper than I thought. Random BigDecimal generation was based on a delegate LongRandomizer which yields in data precision loss (a min of 0.01 was incorrectly converted to 0). This has been fixed and deployed to maven central in version 3.8.0-SNAPSHOT.
@Redid Can you give the fix a try with version 3.8.0-SNAPSHOT (Here is how to import it just in case). Many thanks upfront!
Kr,
Mahmoud
NB: As a side note, while working on this issue, I reported a similar problem with floats (see #318) which I fixed BTW.
Hi random-beans Team,
There is a problem with handling
@DecimalMin / @DecimalMax
as it is not generating fractional part of decimal. I think it is connected with not supporting@Digits
, but you should know about it anyway :)Example:
It is always returning "0", which is invalid value for this case.
Best regards,
Redid
The text was updated successfully, but these errors were encountered: