Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#41505 closed enhancement (fixed)

Pass $decimals argument to number_format_i18n filter

Reported by: alpipego's profile alpipego Owned by: johnbillion's profile johnbillion
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

Filtering the value passed from number_format_l18n is limited as one can only guess the value for $decimals.

$decimals should be passed to the filter, to make it more useful.

Attachments (1)

number_format_l18n.41505.diff (555 bytes) - added by alpipego 7 years ago.

Download all attachments as: .zip

Change History (7)

#1 @alpipego
7 years ago

  • Keywords has-patch added

#2 @johnbillion
7 years ago

  • Milestone changed from Awaiting Review to 4.9
  • Owner set to johnbillion
  • Status changed from new to reviewing

#3 @johnbillion
7 years ago

  • Summary changed from Pass $decimals argument to number_format_l18n filter to Pass $decimals argument to number_format_i18n filter

#4 @johnbillion
7 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 41199:

Formatting: Add the $number and $decimals arguments to the number_format_i18n filter.

Props alpipego

Fixes #41505

#5 follow-up: @johnbillion
7 years ago

@alpipego Thanks for the patch. I added the raw $number parameter too, as the formatted number on its own isn't very useful if you're re-formatting the number.

#6 in reply to: ↑ 5 @alpipego
7 years ago

I added the raw $number parameter too, as the formatted number on its own isn't very useful if you're re-formatting the number.

Ah, that's great, hadn't thought about that. Thanks!

Last edited 7 years ago by alpipego (previous) (diff)
Note: See TracTickets for help on using tickets.