Browsing StarfallEx's section
โ† Back to ACE
Back to StarfallEx

SFEX.math.unitConversion

S๐Ÿท๏ธ Math

Part of StarfallEx namespace

๐Ÿ”— External
math.unitConversion(to, from)
View on GitHub|lua/starfall/libs_sh/math.lua:635
๐Ÿ“‹ Has LDoc๐Ÿ‘๏ธ 0 viewsUpdated 2 months ago

Description

Provides a conversion factor given input units Example: local mph = math.unitConversion(UNIT.MILE / UNIT.HOUR) local converted = x * mph

Parameters

NameTypeDescription
tonumberthe UNIT to convert the number to
from?numberthe UNIT to convert the number from (Default: 1, works if converting from gmod natural units)

Returns

TypeDescription
numberA conversion factor multipled by values to convert units

Examples

No examples available.

Used In

No usages found in the codebase.