We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5939cc1 commit daab8ccCopy full SHA for daab8cc
src/element.js
@@ -602,6 +602,22 @@ const AuthorBaseElement = superClass => class extends superClass {
602
}
603
},
604
605
+ getPercentageDecimal: {
606
+ value: (portion, whole, decimalPlaces = null) => {
607
+ let decimal = portion / whole
608
+
609
+ if (decimal < 0) {
610
+ return 0
611
+ }
612
613
+ if (decimalPlaces !== null) {
614
+ return decimal.toFixed(decimalPlaces)
615
616
617
+ return decimal
618
619
+ },
620
621
/**
622
* @method insertStyleRule
623
* Inserts a new CSS rule-set into the component's shadow root style sheet.
0 commit comments