In the great pht() conversion, some strings like "123,456" are now being printed as numbers with "%d". These come out as "123" instead of "123,456".
Use "%s" and "PhutilNumber" to present numbers with comma groupings.
Differential D12979
Make everything 1000x or 1000000x slower epriestley on May 22 2015, 8:19 PM. Authored by Tags None Referenced Files
Subscribers
Details
In the great pht() conversion, some strings like "123,456" are now being printed as numbers with "%d". These come out as "123" instead of "123,456". Use "%s" and "PhutilNumber" to present numbers with comma groupings.
Diff Detail
Event TimelineComment Actions Constructs like pht('T%d: %s', $task_id, $task_name) or should use integers since T1,234 isn't meaningful. Comment Actions Sure, but how common is that? It could be written as pht('%s: %s', "T{$task_I'd}", $task_name) instead. Comment Actions It's probably less common than it once was since we started introducing getMonogram(), but probably would need a migration pass if we were to change it. We also don't actually parse the %d / %s stuff, and doing so might be unacceptably slow. We could statically forbid %d and then (possibly) auto-box any integers that were passed in with a PhutilNumber. This might be an improvement overall, given that getMonogram() should handle the most common use of %d and you could still force your way around it with (string)$id or whatever if you really didn't want commas. Comment Actions Ah, that explains why my sandbox is so slow this morning. :P JK - feels snappy as ever. :D |