Skip to content

Commit

Permalink
Merge pull request #96 from htmltiger/htmltiger-patch-1
Browse files Browse the repository at this point in the history
secondary info decimal bug fix
  • Loading branch information
htmltiger committed Jul 21, 2023
2 parents 6d58dad + 4673a72 commit fb2a630
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions numberbox-card.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
((LitElement) => {

console.info('NUMBERBOX_CARD 4.12');
console.info('NUMBERBOX_CARD 4.13');
const html = LitElement.prototype.html;
const css = LitElement.prototype.css;
class NumberBox extends LitElement {
Expand Down Expand Up @@ -90,7 +90,14 @@ secondaryInfo(){
for (let d=0; d<t.length; d++){
if(lu.indexOf(t[d])>1){t[d]=t[d].replace('-','_');}
const id = t[d];
if(id[0]=='~'){f=Number(id.substring(1));break;}
if(id[0]=='~'){
f=Number(id.substring(1));
if(!isNaN(f)){
let g=parseFloat(b);
if(isNaN(g)){f=NaN;}else{b=g;}
}
break;
}
if(b.hasOwnProperty(id)){
b=b[id];
if(!d){
Expand Down

0 comments on commit fb2a630

Please sign in to comment.