2 ms·
I do something similar, with a couple of convenience substitutions for commas and multiplication: $ math() { echo "scale=2 ; $" | sed -e "s:x::g" | sed -e "s:,
by geraldcombs 6y ago
I do something similar, with a couple of convenience substitutions for commas and multiplication:
$ math() { echo "scale=2 ; $" | sed -e "s:x::g" | sed -e "s:,::g" | bc; }
$ math 5,382 x 48,927.3
263326728.6
- majewsky 6y agoYou should put this into a codeblock by indenting by 2 spaces. The formatting converts asterisk-delimited text into italics. $ math() { echo "scale=2 ; $*" | sed -e "s:x:*:g" | sed -e "s:,::g" | bc; } $ math 5,382 x 48,927.3 263326728.6