mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 05:01:42 +03:00
11 lines
232 B
TypeScript
11 lines
232 B
TypeScript
// Loaded from https://deno.land/x/segno@v1.1.0/lib/helpers/toFloat.ts
|
|
|
|
|
|
import { isFloat } from '../validations/isFloat.ts';
|
|
|
|
export const toFloat = (str: string) => {
|
|
if (!isFloat(str)) return NaN;
|
|
|
|
return parseFloat(str);
|
|
};
|