Overview
BudgetView stores all financial data in USD (United States Dollars) but displays equivalent amounts in VES (Venezuelan Bolívares) using the official BCV (Banco Central de Venezuela) exchange rate.This dual-currency approach ensures data stability while providing local currency context for Venezuelan users.
How Currency Conversion Works
Storage: USD Only
All amounts are stored in the database as USD:- Stable reference currency
- Consistent historical records
- Independent of exchange rate fluctuations
- Standard for international financial data
Display: USD + VES
When you view data, BudgetView shows both currencies:- Primary:
$50.00 USD - Secondary:
≈ Bs. 1,825.00 BCV(calculated in real-time)
BCV Rate Fetching
API Source
BudgetView fetches the official rate from DolarAPI:Rate Properties
Official Rate
Uses the promedio (average) from BCV’s official exchange rate.This is the government-sanctioned rate.
Real-Time
Fetched fresh on page load (no caching).Updates reflect current market conditions.
Automatic Retry
If fetch fails, the system retries automatically.VES amounts appear once successful.
Fallback Behavior
If rate unavailable, only USD displays.No VES amounts shown (returns
null).The useBcvRate Hook
All pages use this React hook to access the exchange rate:Hook States
- Loading
- Success
- Error
Initial state when page loads.UI shows: “Cargando tasa BCV…”
Input Conversion (Transactions)
When creating transactions, users can input amounts in either currency:USD Input (Default)
VES Input (When BCV Available)
Currency Switcher
Users can switch between USD and VES during input:- User enters
100in USD field - User clicks VES selector
- Field updates to
3650.00(assuming rate of 36.50) - User can continue editing in VES
Real-Time Preview
As you type, a preview shows the equivalent amount:The preview helps you understand what you’re entering in both currencies simultaneously.
Currency Formatting
Formatter Functions
BudgetView uses Intl.NumberFormat for locale-aware formatting:Formatting Examples
Locale Settings
Default locale:es-VE (Venezuelan Spanish)
Number format rules:
- Decimal separator:
,(comma) - Thousands separator:
.(period) - Currency symbol position: Prefix
- Example:
Bs. 1.825.000,50
Where Conversion Appears
1. Wallet Balances
2. Transaction Amounts
3. Budget Limits
4. Summary Cards
5. Export Files
Exported data includes both currencies:Monto (USD): Original stored valueMonto (VES BCV): Converted value at export time
Rate Update Frequency
The BCV rate updates on every page load due to
cache: "no-store" in the fetch request.No Auto-Refresh
The hook does NOT automatically refresh the rate while you’re on the page:Manual Refresh
You can trigger manual refresh using therefresh function:
Currently, no pages implement manual refresh buttons, but the functionality exists.
Edge Cases & Handling
Zero Amounts
Invalid Numbers
Rate Unavailable
bcvRate is null, VES amounts simply don’t render (no error, no placeholder).
Very Large Numbers
Precision Loss
Best Practices
Think in Your Natural Currency
Think in Your Natural Currency
- If you earn/spend in USD → Use USD input
- If you earn/spend in VES → Use VES input
Understand Storage vs Display
Understand Storage vs Display
Remember:
- Storage: Always USD (stable, historical)
- Display: Both USD and VES (informational)
Check Rate Before VES Input
Check Rate Before VES Input
Before entering amounts in VES:
- Verify the BCV rate loaded (shown at top of page)
- Ensure the rate is current/reasonable
- Use the preview to confirm conversion
Review Exports in Both Currencies
Review Exports in Both Currencies
When exporting data:
- Check both
Monto (USD)andMonto (VES BCV)columns - Remember VES values reflect the rate at export time
- For historical accuracy, rely on USD column
Troubleshooting
VES amounts not showing
VES amounts not showing
Possible causes:
- BCV API is down or slow
- Network connection issue
- Page loaded before rate fetched
- Wait a few seconds for rate to load
- Check “Cargando tasa BCV…” message
- Refresh the page
- Check console for fetch errors
Can't select VES input
Can't select VES input
Cause: BCV rate hasn’t loaded yet.Indicator: The VES option is disabled in the currency selector.Solution: Wait for rate to load, or use USD input instead.
VES conversion seems wrong
VES conversion seems wrong
Check:
- Current BCV rate displayed at top of page
- Your calculation: USD × rate = VES
- Decimal rounding (2 places)
Exported VES amounts differ from screen
Exported VES amounts differ from screen
Cause: Exchange rate changed between viewing and exporting.Explanation:
- Screen view: VES calculated with rate from when page loaded
- Export: VES calculated with rate from when export ran
- USD values are identical (source of truth)
Historical data VES amounts changed
Historical data VES amounts changed
Cause: VES equivalents are calculated in real-time using the current rate.Explanation:
- A $50 transaction from January 2024 shows different VES amounts depending on when you view it
- January rate: 36.50 → Bs. 1,825.00
- March rate: 40.00 → Bs. 2,000.00
- USD value ($50) never changes
Related Pages
Tracking Transactions
Learn how to use currency conversion when recording transactions
Creating Wallets
See how wallet balances display in both currencies
Setting Budgets
Understand budget limits and spending in USD/VES
Exporting Data
Export financial data with both USD and VES columns
