from_percent function

Requirements.Units.Conversions.from_percent  ยท source

Icon of from_percent

Convert from percent to a ratio (unit 1)

Extends Modelica.Units.Icons.Conversion

Convert from percent to a ratio (unit 1): r := percent/100. The input percent is a ratio in percent (type NonSI.Percent), the output r the same ratio as a dimensionless number (type Real(unit="1")), e.g. 5 % becomes 0.05. The inverse is to_percent.

The conversion is a multiplication by a constant factor, without offset; it is exact up to floating-point rounding and has no limits on the input (a ratio above 1 gives more than 100 %). The function is inlined. A check model uses it to write a limit of a requirement stated in percent, from_percent(<value as written>), so that the model reads like the statement; see Conversions. Examples.Elementary.Units.Conversions asserts its factor and the round trip to_percent(from_percent(7)).

Copyright © 2026 Model Based Innovation LLC. All rights reserved.

Inputs

NameTypeDescription
percent inputNonSI.PercentValue in percent

Outputs

NameTypeDescription
r outputRealValue as a ratio