////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////


== scale



=== Purpose


Set to the desired scale for floating point numbers (i.e., the number of digits to the right of the decimal point).


=== Examples


[source,groovy]
----
salary scale: 2
----


=== Description


Set to the desired scale for floating point numbers (i.e., the number of digits to the right of the decimal point). This constraint is applicable for properties of the following types: `java.lang.Float`, `java.lang.Double`, and `java.math.BigDecimal` (and its subclasses). When validation is invoked, this constraint determines if the number includes more nonzero decimal places than the scale permits. If so, it rounds the number to the maximum number of decimal places allowed by the scale. This constraint does not generate validation error messages.

This constraint influences  link:{hibernate5GuideFromRef}index.html#constraints[schema generation].

Error Code: N/A
