mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 03:14:32 +02:00
Added some more tests.
Also changed the behavior of some code to meet the expectation.
This commit is contained in:
parent
322778af68
commit
a97d016740
8 changed files with 523 additions and 12 deletions
|
@ -124,7 +124,11 @@ class AmountFormatter
|
|||
}
|
||||
|
||||
//Otherwise just output it
|
||||
$format_string = '%.' . $options['decimals'] . 'f ' . $options['unit'];
|
||||
if (!empty($options['unit'])) {
|
||||
$format_string = '%.' . $options['decimals'] . 'f ' . $options['unit'];
|
||||
} else { //Dont add space after number if no unit was specified
|
||||
$format_string = '%.' . $options['decimals'] . 'f';
|
||||
}
|
||||
return sprintf($format_string, $value);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue