mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
When exporting as human values, format floats according to user preferences.
This commit is contained in:
parent
9d29c16c3a
commit
addb422abe
@ -382,6 +382,22 @@ class importexport_export_csv implements importexport_iface_export_record
|
||||
if ($record->$name && is_numeric($record->$name)) $record->$name = date($GLOBALS['egw_info']['user']['preferences']['common']['dateformat'], $record->$name); // User date format
|
||||
if (!$record->$name) $record->$name = '';
|
||||
}
|
||||
foreach((array)$fields['float'] as $name)
|
||||
{
|
||||
static $dec_separator,$thousands_separator;
|
||||
if (is_null($dec_separator))
|
||||
{
|
||||
$dec_separator = $GLOBALS['egw_info']['user']['preferences']['common']['number_format'][0];
|
||||
if (empty($dec_separator)) $dec_separator = '.';
|
||||
$thousands_separator = $GLOBALS['egw_info']['user']['preferences']['common']['number_format'][1];
|
||||
}
|
||||
if($record->name && (string)$record->$name != '')
|
||||
{
|
||||
$record->name = number_format(str_replace(' ','',$record->name), 2,
|
||||
$dec_separator,$thousands_separator
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Some custom methods for conversion
|
||||
foreach((array)$methods as $name => $method) {
|
||||
|
Loading…
Reference in New Issue
Block a user