simple currency conversion
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 20s

This commit is contained in:
BOTAlex 2025-11-10 02:15:12 +01:00
parent f751f59d6f
commit f60bc1b5e4

22
src/ts/misc/currency.ts Normal file
View file

@ -0,0 +1,22 @@
// Just going to hard code this
// Convertion values gotten at 10/11/2025
export enum CurrencyType {
DKK = 1,
EUR = 7.47,
USD = 6.47,
GBP = 8.5,
}
export function DkkToCurrency(value: number, target: CurrencyType): number {
switch (target) {
case CurrencyType.DKK:
return value * CurrencyType.DKK;
case CurrencyType.EUR:
return value * CurrencyType.EUR;
case CurrencyType.GBP:
return value * CurrencyType.GBP;
case CurrencyType.USD:
return value * CurrencyType.USD;
}
}