Author: zocky
Description:
{{#expr: 45 round 2}} returns "45" instead of "45.00" which would be the
expected behaviour and useful for aligning numbers.
Version: unspecified
Severity: normal
Author: zocky
Description:
{{#expr: 45 round 2}} returns "45" instead of "45.00" which would be the
expected behaviour and useful for aligning numbers.
Version: unspecified
Severity: normal
omniplex wrote:
Not really "broken", all expression results COULD
go through the same normalization at the end, and
that would strip trailing or leading zeros, force
scientific format below E-5 / above 1E12, etc.
Oddity, "round" does return -0 in some cases, so
if you'd want normalized results (the opposite of
your bug report) you have to add 0 to get rid of
the bogus minus sign in -0.
I didn't look at the new "formatnum" magic word,
does it help?
drspui wrote:
If the number of decimal places is given, it should round to that many places to
make it clear that the number is given with that precision. This is broken behavior.
Change 405870 had a related patch set uploaded (by Rammanojpotla; owner: Rammanoj):
[mediawiki/extensions/ParserFunctions@master] Fix improper working of "round" operator
Change 406823 had a related patch set uploaded (by Rammanojpotla; owner: Rammanoj):
[mediawiki/extensions/ParserFunctions@master] Modify rounding technique
See the discussions on the linked Gerrit patches for the reason why I'm declining this ticket after 11 years with nobody else having an issue with the way the round feature works.