Truncates the value of a given numeric expression.
Numeric-expression.Truncate(nK)
Where:
Numeric-expression
Is a Numeric expression that indicates the number the method will be applied to.
nK
Must be a non negative numeric constant.
Type Returned:
Numeric
Data Types:
Numeric
Generators:
.NET,
.NET Framework, Java, RPG, Cobol, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)
Truncates the value of Numeric-expression to nK decimals.
&Val = 1.5
&Val.Truncate(0) // Result: 1
&Val = 1.4
&Val.Truncate(0) // Result: 1
&Val = 1.25
&Val.Truncate(1) // Result: 1.2
&Val = 1.24
&Val.Truncate(1) // Result: 1.2
Trunc function
Round function
Round method