Skip to content

textmode.js / Textmodifier / fract

Method: fract() ​

ts
fract(value): number;

Calculate the fractional part of a number.

This follows GLSL-style fract, so negative inputs return a positive fractional part.

Parameters ​

ParameterTypeDescription
valuenumberValue whose fractional part should be returned.

Returns ​

number

Fractional part in the range 0 up to, but not including, 1.

Example ​