Dec

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 3


Dec (number) Number

ParameterTypeDescription
numberNumberNumber whose decimal portion is returned
Function resultNumberDecimal part of number

Description

Dec returns the decimal (fractional) portion of number. The value returned is always positive or zero.

Example

The following example takes a monetary value expressed as a real number, and extracts the dollar part and the cents part. If vrAmount is 7.31, then vlDollars is set to 7 and vlCents is set to 31:

   vlDollars:=Int (vrAmount)  ` Get the dollars 
   vlCents:=Dec(vrAmount) * 100  ` Get the fractional part

See Also

Int.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next