Skip to content

Commit 8b78624

Browse files
Update readme.md
1 parent 34f1bdc commit 8b78624

File tree

1 file changed

+1
-1
lines changed
  • Server-Side Components/Business Rules/Currency conversion to USD

1 file changed

+1
-1
lines changed

Server-Side Components/Business Rules/Currency conversion to USD/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Validation: Ensures both the currency code and amount are valid before proceedin
66
Currency Check: If the currency is already USD, it bypasses conversion.
77
Exchange Rate Lookup: Retrieves the most recent exchange rates for both the source currency and USD.
88
Conversion Logic: Applies the formula
9-
USD Amount=(Original AmountSource Rate)×USD Rate\text{USD Amount} = \left(\frac{\text{Original Amount}}{\text{Source Rate}}\right) \times \text{USD Rate}USD Amount=(Source RateOriginal Amount​)×USD Rate
9+
USD Amount=(Original AmountSource Rate)×USD Rate\text{USD Amount} = \left(\frac{\text{Original Amount}}{\text{Source Rate}}\right) \times \text{USD Rate}USD Amount=(Source RateOriginal Amount​)×USD Rate.
1010
Error Handling: Clears the USD field if any required data is missing or invalid.
1111

1212
This script ensures accurate and up-to-date currency conversion for budgeting purposes and is well-commented for maintainability and clarity.

0 commit comments

Comments
 (0)