Skip to content

Instantly share code, notes, and snippets.

@mauriciogofas
Forked from dancameron/functions.php
Last active August 29, 2015 14:14
Show Gist options
  • Save mauriciogofas/a146c8f475a0a75fff3d to your computer and use it in GitHub Desktop.
Save mauriciogofas/a146c8f475a0a75fff3d to your computer and use it in GitHub Desktop.
Default Money Formatting for the BR in Sprout Invoices
<?php
// Brazilian money simbol in Sprout Invoices
function set_br_reais_localeconv( $locale = array() ) {
$locale = array(
'decimal_point' => '.',
'thousands_sep' => '',
'int_curr_symbol' => 'BRL',
'currency_symbol' => 'R$',
'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_br_reais_localeconv' );
// End Brazilian money simbol in Sprout Invoices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment