File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -80,12 +80,16 @@ function calculateTotal() {
80
80
totalSpan . classList . add ( "error-highlight" ) ;
81
81
}
82
82
83
- const report = { products : [ ] , tip : tipValue } ;
83
+ const report = { products : [ ] , tip : parseFloat ( tipValue ) } ;
84
84
85
85
for ( let row = 0 ; row < productRows . length ; row ++ ) {
86
86
const nameValue = productRows [ row ] . children [ 0 ] . firstElementChild . value ;
87
- const priceValue = productRows [ row ] . children [ 1 ] . firstElementChild . value ;
88
- const unitValue = productRows [ row ] . children [ 2 ] . firstElementChild . value ;
87
+ const priceValue = parseFloat (
88
+ productRows [ row ] . children [ 1 ] . firstElementChild . value
89
+ ) ;
90
+ const unitValue = parseInt (
91
+ productRows [ row ] . children [ 2 ] . firstElementChild . value
92
+ ) ;
89
93
const product = { name : nameValue , price : priceValue , unit : unitValue } ;
90
94
report . products . push ( product ) ;
91
95
}
You can’t perform that action at this time.
0 commit comments