Parse to float instead of parse to int
This commit is contained in:
parent
7bcb76cffb
commit
513f62a1cf
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
module.exports = function(time){
|
||||
let timeInSeconds = parseInt(time.slice(0, time.length - 1))
|
||||
let timeInSeconds = parseFloat(time.slice(0, time.length - 1))
|
||||
let letter = time.slice(time.length - 1)
|
||||
if(!isNaN(letter)) return parseInt(time) * 60;
|
||||
if(!isNaN(letter)) return parseFloat(time) * 60;
|
||||
switch (letter.toUpperCase()) {
|
||||
case "H":
|
||||
timeInSeconds = timeInSeconds * 3600; // 3 600 000
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue