"use strict";
const _ = require("lodash");
module.exports = function toSafestNumber(string) {
    return _.chain(string)
        .replace(",", ".")
        .thru(s => parseFloat(s))
        .thru(s => {
            if (!_.isNaN(s)) {
                return _.round(s, 2);
            }
        })
        .value();
};


// console.log(toSafestNumber())
// console.log(toSafestNumber("."))
// console.log(toSafestNumber(","))
// console.log(toSafestNumber("1"))
// console.log(toSafestNumber("222.222"))
// console.log(toSafestNumber("222,555"))
// console.log(toSafestNumber("fds"))
// console.log(toSafestNumber("-2"))

@@ -328,30 +328,30 @@
 ole.log(
-toSafestNumber
+module.exports
 ())%0A// c
@@ -361,30 +361,30 @@
 ole.log(
-toSafestNumber
+module.exports
 (%22.%22))%0A/
@@ -397,30 +397,30 @@
 ole.log(
-toSafestNumber
+module.exports
 (%22,%22))%0A/
@@ -433,30 +433,30 @@
 ole.log(
-toSafestNumber
+module.exports
 (%221%22))%0A/
@@ -465,38 +465,38 @@
 console.log(
-toSafestNumber
+module.exports
 (%22222.222%22))
@@ -511,30 +511,30 @@
 ole.log(
-toSafestNumber
+module.exports
 (%22222,55
@@ -553,30 +553,30 @@
 ole.log(
-toSafestNumber
+module.exports
 (%22fds%22))
@@ -591,30 +591,30 @@
 ole.log(
-toSafestNumber
+module.exports
 (%22-2%22))%0A

Update test logs