[#mp_units-scale] = xref:mp_units.adoc[mp_units]::scale :relfileprefix: ../ :mrdocs: Scale `value` by the unit magnitude passed as `m,` converting to type `To.` == Synopsis Declared in `<mp‐units/framework/scaling.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename To, xref:mp_units/UnitMagnitude.adoc[UnitMagnitude] M, typename From> requires detail::MagnitudeScalable<From> [[nodiscard]] constexpr auto scale( M m, From const& value); ---- == Description When `From` provides a magnitude‐aware `operator*(From,M)` customization point, it is used first. The return type may differ from `To` (e.g. a representation with scaled bounds). Otherwise, the built‐in floating‐point or integer path is used and the result type is `To.` Use this in custom `operator*(T, UnitMagnitude)` implementations to reuse the library's built‐in scaling logic instead of duplicating it. [.small]#Created with https://www.mrdocs.com[MrDocs]#