fivem-ts

a library to speed up the development of Fivem scripts and frameworks


Project maintained by Purpose-Dev Hosted on GitHub Pages — Theme by mattgraham

fivem-ts - Documentation v0.7.5Docs


fivem-ts - Documentation v0.7.5 / Shared / mapRange

Function: mapRange()

mapRange(value, inMin, inMax, outMin, outMax): number

Maps a value from one range to another.

Parameters

value: number

The value to map.

inMin: number

The minimum value of the input range.

inMax: number

The maximum value of the input range.

outMin: number

The minimum value of the output range.

outMax: number

The maximum value of the output range.

Returns

number

The mapped value.

Example

mapRange(5, 0, 10, 0, 100); // 50

Defined in

shared/utils/FMath.ts:166