Skip to content

Function: percentToEmu() ​

percentToEmu(percent, axisEmu): Emu

Resolve a percentage of an axis length to EMU.

Published for consumers, and reached from one place inside src/ on purpose. Internally only parseCoord needs it, because every '50%' a caller writes comes through there; it is exported because a consumer computing its own geometry against a slide axis needs the same arithmetic, and it belongs with the rest of the conversion set beside it rather than hidden behind the one caller. Left exported deliberately rather than by oversight — this note is the difference between the two, as it is on emuToPixels.

Parameters ​

ParameterTypeDescription
percentnumberpercentage value (e.g. 50 for 50%)
axisEmunumberthe axis length in EMU (slide width for x/w, height for y/h)

Returns ​

Emu