1
0
Fork 0
mirror of synced 2024-09-19 02:39:37 +12:00
budibase/packages/common/node_modules/istanbul-lib-coverage/lib/percent.js
2020-04-15 15:23:29 +01:00

15 lines
371 B
JavaScript

/*
Copyright 2012-2015, Yahoo Inc.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
module.exports = function percent(covered, total) {
let tmp;
if (total > 0) {
tmp = (1000 * 100 * covered) / total + 5;
return Math.floor(tmp / 10) / 100;
} else {
return 100.0;
}
};