Homec4science

parse with %s as `number_format()` returns stirng

Authored by Gareth Evans <garoevans@gmail.com> on May 13 2013, 17:09.

Description

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

Details

Committed
epriestley <git@epriestley.com>May 13 2013, 17:09
Pushed
aubortJan 31 2017, 17:16
Parents
rPHc5929e376cbe: Fix placeholder color
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH9c87ba8b09a7: parse with %s as `number_format()` returns stirng (authored by Gareth Evans <garoevans@gmail.com>).May 13 2013, 17:09