acuminous/yadda

View on GitHub
lib/converters/float-converter.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
'use strict';

module.exports = function float_converter(value, next) {
  var converted = parseFloat(value);
  if (isNaN(converted)) return next(new Error('Cannot convert [' + value + '] to a float'));
  return next(null, converted);
};