Ver Mensaje Individual
  #2  
Antiguo 06-08-2015
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is offline
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.038
Reputación: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
A ver si te sirve:
Cita:
SCALED DATATYPES

Purpose
Use a scaled datatype to hold numbers with fixed size fractions.
Syntax
<scaled_type> ::=
{DECIMAL | NUMERIC} [(precision [, scale])]



Semantics
Firebird supports two scaled datatypes, NUMERIC and DECIMAL, for handling numeric data with a fixed decimal point, such as monetary values. You can specify optional precision and scale factors for both datatypes:
  • Precision is the total number or maximum number of digits, both significant and fractional, that can appear in a column of these datatypes. The allowable range for precision is from 1 to a maximum of 18.
  • Scale is the number of digits to the right of the decimal point that comprise the fractional portion of the number. The allowable range for scale is from zero to precision; in other words, scale must be less than or equal to precision.
NUMERIC and DECIMAL differ subtly in the way they handle numbers larger than the specified size. NUMERIC defines a datatype that holds a maximum of precision digits, whereas DECIMAL defines a datatype that holds at least that number of digits, and possibly more.
You can specify NUMERIC and DECIMAL datatypes without precision, in which case they are identical to INTEGER. The default value for scale is zero.
The below example declares a variable of type NUMERIC:
DECLARE a NUMERIC(5,3);



See also
INTEGER DATATYPE, FLOAT DATATYPE
Responder Con Cita