does it even matter? #286

Merged
ptran merged 2 commits from number-omit into main 2025-06-04 10:35:10 +00:00
Showing only changes of commit e35a30a606 - Show all commits

View file

@ -63,7 +63,7 @@ export class AnimatedNumberComponent implements OnChanges, AfterViewInit {
duration: this.duration, duration: this.duration,
decimalPlaces: 2, decimalPlaces: 2,
useEasing: true, useEasing: true,
useGrouping: false, // We'll handle grouping in the formatting function useGrouping: false,
easingFn: (t, b, c, d) => { easingFn: (t, b, c, d) => {
if (this.ease === 'power1.out') { if (this.ease === 'power1.out') {
return c * (1 - Math.pow(1 - t / d, 1)) + b; return c * (1 - Math.pow(1 - t / d, 1)) + b;
@ -71,14 +71,12 @@ export class AnimatedNumberComponent implements OnChanges, AfterViewInit {
return c * (t / d) + b; return c * (t / d) + b;
}, },
formattingFn: (value) => { formattingFn: (value) => {
// Ensure we preserve the exact decimal value during animation
const numericValue = typeof value === 'string' ? parseFloat(value) : value;
const formatted = new Intl.NumberFormat('de-DE', { const formatted = new Intl.NumberFormat('de-DE', {
style: 'currency', style: 'currency',
currency: 'EUR', currency: 'EUR',
minimumFractionDigits: 2, minimumFractionDigits: 2,
maximumFractionDigits: 2, maximumFractionDigits: 2,
}).format(numericValue); }).format(value);
this.formattedValue = formatted; this.formattedValue = formatted;
return formatted; return formatted;
}, },