mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-08 15:08:59 +01:00
* EventMgr: fixed fatal error eventmgr_merge::number_format() is not defined
This commit is contained in:
parent
a69151c7f8
commit
fd9d3315cd
@ -711,4 +711,27 @@ abstract class bo_merge
|
|||||||
}
|
}
|
||||||
common::egw_exit();
|
common::egw_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format a number according to user prefs with decimal and thousands separator
|
||||||
|
*
|
||||||
|
* Reimplemented from etemplate to NOT use user prefs for Excel 2003, which gives an xml error
|
||||||
|
*
|
||||||
|
* @param int|float|string $number
|
||||||
|
* @param int $num_decimal_places=2
|
||||||
|
* @param string $_mimetype=''
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
static public function number_format($number,$num_decimal_places=2,$_mimetype='')
|
||||||
|
{
|
||||||
|
if ((string)$number === '') return '';
|
||||||
|
//error_log(__METHOD__.$_mimetype);
|
||||||
|
switch($_mimetype)
|
||||||
|
{
|
||||||
|
case 'application/xml': // Excel 2003
|
||||||
|
case 'application/vnd.oasis.opendocument.spreadsheet': // OO.o spreadsheet
|
||||||
|
return number_format(str_replace(' ','',$number),$num_decimal_places,'.','');
|
||||||
|
}
|
||||||
|
return etemplate::number_format($number,$num_decimal_places);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user