1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

parse with %s as number_format() returns stirng

Summary:
`number_format()` returns a string, so if passed a number greater than 999 by default it will add commas, which parsed by %d will only return the 1000's delimter.

```echo sprintf("%d", number_format(1000)); // Outputs 1
echo sprintf("%s", number_format(1000)); // Outputs 1,000

Test Plan: Looked at repos with over 999 commits.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5913
This commit is contained in:
Gareth Evans 2013-05-13 08:09:08 -07:00 committed by epriestley
parent c5929e376c
commit 9c87ba8b09

View file

@ -94,7 +94,7 @@ final class DiffusionHomeController extends DiffusionController {
'callsign' => $repository->getCallsign(),
'action' => 'history',
)),
pht('%d Commits', number_format($size)));
pht('%s Commits', new PhutilNumber($size)));
}
$lint_count = '';
@ -110,7 +110,7 @@ final class DiffusionHomeController extends DiffusionController {
'action' => 'lint',
)),
),
pht('%d Lint Messages', number_format($lint_branches[$branch])));
pht('%s Lint Messages', new PhutilNumber($lint_branches[$branch])));
}
$datetime = '';