I have a need to maintain my value as a float. So I gave my field this parser:
export const parseDecimal = value => value ? parseFloat(value) : value;
export const formatNumber = value => typeof value === 'number' ? value.toString() : value; // <TextInput> freaks out with string
I use it in my field like this:
<Field name="decimal" parse={parseDecimal} format={formatNumber} />
I have to use formateNumber, which makes the number into a string because I am using react-native and the <TextInput> element only works with strings.
However anytime I hit the . to write a decimal it gets blocked/removed. Is there anyway to allow a decimal but continuously parseFloat it?