Spaces:
Sleeping
Sleeping
File size: 480 Bytes
1070765 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | // default value format (apply autopadding)
// format valueset
module.exports = function formatValue(v, options, type){
// no autopadding ? passthrough
if (options.autopadding !== true){
return v;
}
// padding
function autopadding(value, length){
return (options.autopaddingChar + value).slice(-length);
}
switch (type){
case 'percentage':
return autopadding(v, 3);
default:
return v;
}
} |