Private
Public Access
1
0

feat: Fluent UI Outlook Lite + connections mockup

This commit is contained in:
2026-04-14 18:52:25 +00:00
parent 1199eff6c3
commit dfa4010406
34820 changed files with 1003813 additions and 205 deletions

View File

@@ -0,0 +1,46 @@
/**
* Calculates a number's precision based on the number of trailing
* zeros if the number does not have a decimal indicated by a negative
* precision. Otherwise, it calculates the number of digits after
* the decimal point indicated by a positive precision.
* @param value - the value to determine the precision of
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
calculatePrecision: function() {
return calculatePrecision;
},
precisionRound: function() {
return precisionRound;
}
});
function calculatePrecision(value) {
/**
* Group 1:
* [1-9]([0]+$) matches trailing zeros
* Group 2:
* \.([0-9]*) matches all digits after a decimal point.
*/ const groups = /[1-9]([0]+$)|\.([0-9]*)/.exec(String(value));
if (!groups) {
return 0;
}
if (groups[1]) {
return -groups[1].length;
}
if (groups[2]) {
return groups[2].length;
}
return 0;
}
function precisionRound(value, precision, base = 10) {
const exp = base ** precision;
return Math.round(value * exp) / exp;
}