fix: handle negative-zero and half-cent rounding in formatGermanAmount
This commit is contained in:
@@ -68,7 +68,9 @@ const TYPE_LABELS: Record<string, string> = {
|
||||
};
|
||||
|
||||
function formatGermanAmount(value: number): string {
|
||||
return value.toFixed(2).replace('.', ',');
|
||||
const rounded = Math.round((value + Number.EPSILON) * 100) / 100;
|
||||
const normalized = rounded === 0 ? 0 : rounded;
|
||||
return normalized.toFixed(2).replace('.', ',');
|
||||
}
|
||||
|
||||
function escapeCsvField(value: string): string {
|
||||
|
||||
Reference in New Issue
Block a user