mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-08 01:08:50 -06:00
web: Improve CSV validation
This commit is contained in:
@@ -40,7 +40,9 @@ export const generateUniqueName = (container: any, prefix: string): string => {
|
||||
return name;
|
||||
};
|
||||
|
||||
const parseNumber = (valueStr: string): [number, ValidationError | null] => {
|
||||
export const parseNumber = (
|
||||
valueStr: string,
|
||||
): [number, ValidationError | null] => {
|
||||
const valueFloat = parseFloat(valueStr);
|
||||
if (isNaN(valueFloat)) {
|
||||
return [0, { message: `"${valueStr}" is not a valid number` }];
|
||||
|
||||
Reference in New Issue
Block a user