Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

percent.js 371B

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