StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
StackGenVis/frontend/node_modules/pad-right/index.js

21 lines
489 B

4 years ago
'use strict';
var repeat = require('repeat-string');
module.exports = function padLeft(val, num, str) {
var padding = '';
var diff = num - val.length;
// Breakpoints based on benchmarks to use the fastest approach
// for the given number of zeros
if (diff <= 5 && !str) {
padding = '00000';
} else if (diff <= 25 && !str) {
padding = '000000000000000000000000000';
} else {
return val + repeat(str || '0', diff);
}
return val + padding.slice(0, diff);
};