### Description - We added a decimal field for a Number Field type in the settings - We updated the Number Field type create a form with decimals input - We are not implementing the dropdown present on the Figma because it seems not related ### Demo <https://www.loom.com/share/18a8d4b712a14f6d8b66806764f8467f?sid=3fc79b46-ae32-46e3-8635-d0eee02e53b2> Fixes #6987 --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
9 lines
291 B
TypeScript
9 lines
291 B
TypeScript
export const DEFAULT_DECIMAL_VALUE = 0;
|
|
|
|
export const formatNumber = (value: number, decimals?: number): string => {
|
|
return value.toLocaleString('en-US', {
|
|
minimumFractionDigits: decimals ?? DEFAULT_DECIMAL_VALUE,
|
|
maximumFractionDigits: decimals ?? DEFAULT_DECIMAL_VALUE,
|
|
});
|
|
};
|