From 04b2e9629fb4ab7ae28bcc31cd220bfb3d7f505b Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Fri, 25 Aug 2023 16:17:19 +0200 Subject: [PATCH] math: Fix docs on --scale Fixes #9983 (cherry picked from commit e555f1b2355a059d115e7c505ae46bf15de281a6) --- doc_src/cmds/math.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc_src/cmds/math.rst b/doc_src/cmds/math.rst index 82c376d33..ed84b0e07 100644 --- a/doc_src/cmds/math.rst +++ b/doc_src/cmds/math.rst @@ -17,8 +17,9 @@ Description ``math`` performs mathematical calculations. It supports simple operations such as addition, subtraction, and so on, as well as functions like ``abs()``, ``sqrt()`` and ``ln()``. -By default, the output is a floating-point number with trailing zeroes trimmed. -To get a fixed representation, the ``--scale`` option can be used, including ``--scale=0`` for integer output. +By default, the output shows up to 6 decimal places. +To change the number of decimal places, use the ``--scale`` option, including ``--scale=0`` for integer output. +Trailing zeroes will always be trimmed. Keep in mind that parameter expansion happens before expressions are evaluated. This can be very useful in order to perform calculations involving shell variables or the output of command substitutions, but it also means that parenthesis (``()``) and the asterisk (``*``) glob character have to be escaped or quoted.