HomePhorge

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

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

Provenance
Gareth EvansAuthored on May 13 2013, 8:09 AM
epriestleyCommitted on May 13 2013, 8:09 AM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rPc5929e376cbe: Fix placeholder color
Branches
Unknown
Tags
Unknown

Event Timeline