Last modified: 2008-09-14 00:19:34 UTC
Hi! You guys are doing a great job! The MOS states that the unicode minus (and variously or not(!?), the en dash) are to be used to negate numbers and to represent subtraction. Sometimes these representations are used for display and calculation in the same template call. Minus and en dash are not evaluated correctly by the #expr parser function (see http://en.wikipedia.org/wiki/User:Saintrain/A/NegTest). If we can't use the hyphen (as the Lords of FORTRAN intended) then the parser functions should handle the typographic characters.
I don't think en dash should be handled as a minus sign. That's just wrong. The minus sign should, though, for all us typography Nazis.
en dash is no longer in the MOS as a couple weeks ago. (So Aryeh, that's a vote "for", yes? :-) Looks like a simple "str_replace" in Expr.php.
If somebody were willing to write a patch, I'd be willing to test and commit it. Brion has expressed reservations about the necessity of typographic exactitude in MediaWiki numerical formatting before, though, over at bug 8327 comment 2. :) So I can't promise it will stick, but I don't see why not.
I am a little concerned about this, but I don't know why. I can't see any other sensible way to do this, though. (template, str_replace, they won't work on the wiki).
(In reply to comment #4) > (template, str_replace, they won't work on the wiki).
(In reply to comment #3) > Brion has expressed reservations about the necessity of typographic > exactitude ... And I agree with him; hyphen, minus, I don't care but Expr.php does. I just want to calculate with old numbers without getting reverted by people who do care about the typo-crap.
(In reply to comment #3) > If somebody were willing to write a patch, Sorry, I don't have no steenking patches, but changing # Unescape inequality operators $expr = strtr( $expr, array( '<' => '<', '>' => '>' ) ); to # Unescape inequality operators. Change minuses to hyphens $expr = strtr( $expr, array( '<' => '<', '>' => '>', '−' => '-' ) ); at about line# 169 of Expr.php (near the top of doExpression()) should do it. (Looks like this issue has come up before, typographical-to-calculationical. :-) Thanks.
Committed in r40762, and allowed to tolerate U+2212 "−" as well.
(In reply to comment #8) > Committed in r40762, and allowed to tolerate U+2212 "−" as well. Many thanks. Doug P.s. Very roughly, round numbers, how long to get to en? That is, what's the usual time for such things?
Typically on the order of a week.