frac()
Table of Contents
Overview
The frac() function takes a decimalValue as an argument, and returns only the fraction part of the value. For example, the fraction part of 2.50 is 0.50.
Return Type
- Number
Syntax
<variable> = <inputNumber>.frac();
(OR)
<variable> = frac(<inputNumber>);
Parameter | Data type | Description |
---|---|---|
<variable> | NUMBER | Variable that will contain the returned value. |
<inputNumber> | NUMBER | The input number whose fraction part is required. |
Examples
inputNumber = 24.6; info inputNumber.frac(); // Returns 0.6 inputNumber = -25.1; info frac(inputNumber); // Returns -0.1