Skip to content

Commit ef0e23b

Browse files
#70 Resolved.
1 parent 00c5398 commit ef0e23b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/react-forms/src/modifiers/string-to-decimal.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ export class StringToDecimalModifier extends BaseModifier<StringToDecimalProps,
1717

1818
private static emptyFormattedValue: string;
1919

20+
public componentWillMount(): void {
21+
if (this.props.delimiter == null || this.props.delimiter.length !== 1) {
22+
throw new Error(`StringToDecimalModifier: delimiter prop has to be exactly one character long.`);
23+
}
24+
}
25+
2026
public Format(value: FieldValue): FieldValue {
2127
if (value !== EMPTY_VALUE) {
2228
return value.toString();

0 commit comments

Comments
 (0)