File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -120,4 +120,5 @@ coverage.lcov
120120.nyc_output /
121121
122122.vscode
123- t.js
123+ t.js
124+ s.js
Original file line number Diff line number Diff line change @@ -211,18 +211,19 @@ class CurrencyConverter {
211211 else
212212 return got ( `https://www.google.co.in/search?q=${ this . currencyAmount } +${ this . currencyFrom } +to+${ this . currencyTo } ` )
213213 . then ( ( html ) => {
214- // const fs = require('fs');
214+ const fs = require ( 'fs' ) ;
215215
216- // fs.writeFile("a.html", html.body, function(err) {
217- // if(err) {
218- // return console.log(err);
219- // }
220- // console.log("The file was saved!") })
216+ fs . writeFile ( "a.html" , html . body , function ( err ) {
217+ if ( err ) {
218+ return console . log ( err ) ;
219+ }
220+ console . log ( "The file was saved!" ) } )
221221 return cheerio . load ( html . body ) } )
222222 . then ( ( $ ) => { return $ ( ".iBp4i" ) . text ( ) . split ( " " ) [ 0 ] } )
223223 . then ( ( rates ) => {
224+ console . log ( rates )
224225 if ( rates . includes ( "," ) )
225- rates = rates . replace ( "," , "" )
226+ rates = rates . replaceAll ( "," , "" )
226227 return parseFloat ( rates )
227228 } )
228229 }
You can’t perform that action at this time.
0 commit comments