Skip to content

Instantly share code, notes, and snippets.

@dancameron
Created January 30, 2015 16:30
Show Gist options
  • Save dancameron/a10a8a7829212687c646 to your computer and use it in GitHub Desktop.
Save dancameron/a10a8a7829212687c646 to your computer and use it in GitHub Desktop.
Default Money Formatting for the US
<?php
function set_us_dollars_localeconv( $locale = array() ) {
$locale = array(
'decimal_point' => '.',
'thousands_sep' => '',
'int_curr_symbol' => 'USD',
'currency_symbol' => '$',
'mon_decimal_point' => '.',
'mon_thousands_sep' => ',',
'positive_sign' => '',
'negative_sign' => '-',
'int_frac_digits' => 2,
'frac_digits' => 2,
'p_cs_precedes' => 1,
'p_sep_by_space' => 0,
'n_cs_precedes' => 1,
'n_sep_by_space' => 0,
'p_sign_posn' => 1,
'n_sign_posn' => 1,
'grouping' => array(),
'mon_grouping' => array( 3, 3 ),
);
return $locale;
};
add_filter( 'si_localeconv', 'set_us_dollars_localeconv' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment