mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 16:07:33 +08:00
migrate exchange rates page to composition API and typescript
This commit is contained in:
@@ -285,15 +285,3 @@ export function getExchangedAmountByRate(amount: number, fromRate: string, toRat
|
||||
|
||||
return amount * exchangeRate;
|
||||
}
|
||||
|
||||
export function getConvertedAmount(baseAmount: number | '', fromExchangeRate: { rate: string }, toExchangeRate: { rate: string }): number | '' | null {
|
||||
if (!fromExchangeRate || !toExchangeRate) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (baseAmount === '') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return getExchangedAmountByRate(baseAmount as number, fromExchangeRate.rate, toExchangeRate.rate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user