When putting a decimal into your DB, what does the precision mean and
what does scale mean?
~Jeremy
When putting a decimal into your DB, what does the precision mean and
what does scale mean?
~Jeremy
Jeremy W. wrote:
When putting a decimal into your DB, what does the precision mean and
what does scale mean?~Jeremy
ok, I got it. so precision is the total amount of digits to the left and
right of the decimal that the number can contain, and the scale is the
amount of digits to the right that the number can contain.
~Jeremy
When putting a decimal into your DB, what does the precision mean and
what does scale mean?
section 8.1.2…
The scale of a numeric is the count of decimal digits in the fractional
part, to the right of the decimal point. The precision of a numeric is
the
total count of significant digits in the whole number, that is, the
number
of digits to both sides of the decimal point. So the number 23.5141 has
a
precision of 6 and a scale of 4. Integers can be considered to have a
scale of zero.
It’s the same for other databases as well…
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs