In the Bean Validation spec ( both version JSR 303 and JSR 349 ) and docs, both don't mention anything about @Digits support for Double or Float types. It only says it supports the following types:
- BigDecimal
- BigInteger
- CharSequence
- byte, short, int, long, and their respective wrapper types
However, I tested it many times against Double fields in my entities and I found that it works well!
Does it have any drawbacks that I can not see? Is it discouraged to use it with Double?
Also I found the documentation does explicitly say that @Min and @Max don't support Double and Float. However, It is not that clear about the @Digits