[#mp_units-scale-05] = xref:mp_units.adoc[mp_units]::scale :relfileprefix: ../ :mrdocs: `scale` overloads == Synopses Declared in `<mp‐units/framework/scaling.h>` Scale `value` by the unit magnitude passed as `m,` converting to type `To.` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename To, xref:mp_units/UnitMagnitude.adoc[UnitMagnitude] M, typename From> requires detail::UnitMagnitudeScalable<From> [[nodiscard]] constexpr auto xref:mp_units/scale-0e.adoc[scale]( M m, From const& value); ---- [.small]#xref:mp_units/scale-0e.adoc[_» more..._]# Scale `value` by the unit magnitude passed as `m,` converting to type `To,` with the result rounded according to `policy.` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename To, xref:mp_units/UnitMagnitude.adoc[UnitMagnitude] M, typename From, xref:mp_units/RoundingPolicy.adoc[RoundingPolicy] Policy> requires detail::UnitMagnitudeScalable<From> [[nodiscard]] constexpr auto xref:mp_units/scale-00.adoc[scale]( M m, From const& value, Policy policy); ---- [.small]#xref:mp_units/scale-00.adoc[_» more..._]# == Return Value * `value` scaled by `m,` truncated to type `To` * `value` scaled by `m,` rounded to type `To` according to `policy` [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *m* | unit magnitude to scale `value` by | *value* | value being scaled | *policy* | rounding policy tag selecting how the scaled result is rounded |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#