math.floor fix

This commit is contained in:
adambla76 2019-11-10 19:15:29 +01:00 committed by Baozhu Zuo
parent f1dba411b0
commit dff3c9bf76
2 changed files with 7 additions and 7 deletions

12
main.ts
View File

@ -270,23 +270,23 @@ namespace grove {
else if(dispData < 100)
{
this.bit(dispData % 10, 3);
this.bit((dispData / 10) % 10, 2);
this.bit(Math.floor(dispData / 10) % 10, 2);
this.bit(0x7f, 1);
this.bit(0x7f, 0);
}
else if(dispData < 1000)
{
this.bit(dispData % 10, 3);
this.bit((dispData / 10) % 10, 2);
this.bit((dispData / 100) % 10, 1);
this.bit(Math.floor(dispData / 10) % 10, 2);
this.bit(Math.floor(dispData / 100) % 10, 1);
this.bit(0x7f, 0);
}
else
{
this.bit(dispData % 10, 3);
this.bit((dispData / 10) % 10, 2);
this.bit((dispData / 100) % 10, 1);
this.bit((dispData / 1000) % 10, 0);
this.bit(Math.floor(dispData / 10) % 10, 2);
this.bit(Math.floor(dispData / 100) % 10, 1);
this.bit(Math.floor(dispData / 1000) % 10, 0);
}
}

View File

@ -1,6 +1,6 @@
{
"name": "Grove",
"version": "0.1.6",
"version": "0.1.7",
"description": "A Microsoft MakeCode package for Seeed Studio Grove module",
"license": "MIT",
"dependencies": {