Skip to content
Permalink
Browse files

pushing fix for broken currency formating. #480.

  • Loading branch information
Peter Adams
Peter Adams committed Mar 10, 2020
1 parent 30e3afb commit dc4dcadd9f8f8bf73a97d4636fb21a02fe0ade2b
Showing with 13 additions and 3 deletions.
  1. +1 −1 modules/base/classes/resultSetManager.php
  2. +12 −2 owa_lib.php
@@ -887,7 +887,7 @@ function applyMetaDataToSingleResultRow($row) {
'name' => $k,
'value' => $v,
'formatted_value' => $this->formatValue($data_type, $v),
'label' => $this->getLabel($k), 'data_type' => $data_type);
'label' => $this->getLabel($k), 'data_type' => $data_type);
}

return $new_row;
@@ -1126,9 +1126,19 @@ public static function checkForUtf8($str) {
}

public static function formatCurrency($value, $local, $currency) {

$value = $value / 100;
$numberFormatter = new NumberFormatter($local, NumberFormatter::CURRENCY);
return $numberFormatter->formatCurrency($value, $currency);

if ( function_exists('numfmt_create') ) {

$numberFormatter = new NumberFormatter($local, NumberFormatter::CURRENCY);
return $numberFormatter->formatCurrency($value, $currency);

} else {

setlocale( LC_MONETARY, $local );
return money_format( '%.' . 2 . 'n',$value );
}
}

public static function crc32AsHex($string) {

0 comments on commit dc4dcad

Please sign in to comment.
You can’t perform that action at this time.