From 01dbd0251987cd5c66010a87b18e89281b675706 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Mon, 8 Jan 2024 10:30:45 +0100 Subject: [PATCH] docs: "Value-truncating conversions" chapter updated as `value_cast` now properly works on quantity points --- .../framework_basics/value_conversions.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/users_guide/framework_basics/value_conversions.md b/docs/users_guide/framework_basics/value_conversions.md index 2181d986b..e31575ca2 100644 --- a/docs/users_guide/framework_basics/value_conversions.md +++ b/docs/users_guide/framework_basics/value_conversions.md @@ -98,10 +98,10 @@ the `value_cast(q)` which always returns the most precise result: } // namespace unit_symbols - using Price = quantity; - using Scaled = quantity; + using Price = quantity_point; + using Scaled = quantity_point, std::int64_t>; - Price price = 12.95 * USD; + Price price{12.95 * USD}; Scaled spx = value_cast(price); ``` @@ -121,10 +121,10 @@ the `value_cast(q)` which always returns the most precise result: } // namespace unit_symbols - using Price = quantity; - using Scaled = quantity; + using Price = quantity_point; + using Scaled = quantity_point, std::int64_t>; - Price price = 12.95 * USD; + Price price{12.95 * USD}; Scaled spx = value_cast(price); ``` @@ -144,9 +144,9 @@ the `value_cast(q)` which always returns the most precise result: } // namespace unit_symbols - using Price = quantity; - using Scaled = quantity; + using Price = quantity_point; + using Scaled = quantity_point, std::int64_t>; - Price price = 12.95 * USD; + Price price{12.95 * USD}; Scaled spx = value_cast(price); ```