Choose where you’d like to start

frac()

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>);
ParameterData typeDescription
<variable>NUMBERVariable that will contain the returned value.
<inputNumber>NUMBERThe 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

Related Links

Get Started Now

Execute