File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -219,23 +219,16 @@ <h3 class="h5 card-title">Explore More Currency Tools</h3>
219219 function populateCurrencies ( ) {
220220 fromSelect . innerHTML = '' ;
221221 toSelect . innerHTML = '' ;
222-
223- // Sort currencies alphabetically
224- const sortedCurrencies = Object . keys ( conversionRates ) . sort ( ( a , b ) => {
225- return currencyNames [ a ] . localeCompare ( currencyNames [ b ] ) ;
226- } ) ;
227-
228- for ( const currencyCode of sortedCurrencies ) {
222+ for ( const currencyCode in conversionRates ) {
229223 const fullName = currencyNames [ currencyCode ] || currencyCode ;
230224 const optionText = `${ currencyCode } - ${ fullName } ` ;
231225
232226 fromSelect . add ( new Option ( optionText , currencyCode ) ) ;
233227 toSelect . add ( new Option ( optionText , currencyCode ) ) ;
234228 }
235229
236- // Set default values
237- fromSelect . value = 'SAR' ;
238- toSelect . value = 'PKR' ;
230+ fromSelect . value = 'SAR' ; // Default to SAR
231+ toSelect . value = 'PKR' ; // Default to PKR
239232
240233 fieldset . disabled = false ;
241234 statusText . textContent = `Rates last updated: ${ new Date ( lastUpdated ) . toLocaleString ( ) } ` ;
You can’t perform that action at this time.
0 commit comments