@decidables/decidables-elements
Version:
decidables-elements: Basic UI Web Components for the decidables project
16 lines (13 loc) • 410 B
JavaScript
/*
Attribute: Space-separated sequence of numbers
Property: Array of numbers
*/
const DecidablesConverterArray = {
fromAttribute: (value) => {
return value.split(/\s+/).map((item) => { return Number.parseFloat(item); });
},
toAttribute: (value) => {
return (value.length) ? value.map((item) => { return item.toFixed(3); }).join(' ') : null;
},
};
export default DecidablesConverterArray;