This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
Dec
|
Dec ( number ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
number | Real |
![]() |
Number whose decimal portion is returned | |||||
Function result | Real |
![]() |
Decimal part of number | |||||
Dec returns the decimal (fractional) portion of number.The value returned is always positive or zero.
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
Product: 4D
Theme: Math
Number:
9
Created: < 4D v6
4D Language Reference ( 4D v20 R7)