Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stefancosquer committed Apr 8, 2021
1 parent 0b15714 commit e999824
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions carbonara.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Carbonara extends HTMLElement {

private transfer = 0;
private duration = 0;
private frequency = 500;
private frequency = 200;
private timer: number;
private store: Storage;

Expand Down Expand Up @@ -125,10 +125,10 @@ class Carbonara extends HTMLElement {
const carbon = kWhDataCenter + kWhNetwork + kWhDevice;
this.shadowRoot.getElementById("device").textContent = `${i18n[this.language].device} ${this.mobile ? "mobile" : "desktop"}`;
this.shadowRoot.getElementById("zone").textContent = `${i18n[this.language].zone} ${this.zone}`;
this.shadowRoot.getElementById("transfer").textContent = `${i18n[this.language].transfer} ${Math.round(transfer / 1024)} ko`;
this.shadowRoot.getElementById("duration").textContent = `${i18n[this.language].duration} ${Math.round(this.duration * 60)} s`;
this.shadowRoot.getElementById("transfer").textContent = `${i18n[this.language].transfer} ${Intl.NumberFormat().format(Math.round(transfer / 1024))} ko`;
this.shadowRoot.getElementById("duration").textContent = `${i18n[this.language].duration} ${Intl.NumberFormat().format(Math.round(this.duration * 60))} s`;
this.shadowRoot.getElementById("reinsurance").textContent = `${i18n[this.language].reinsurance}`;
this.shadowRoot.getElementById("carbon").textContent = `${Intl.NumberFormat([],{maximumFractionDigits: 3}).format(carbon)} gCO2e`;
this.shadowRoot.getElementById("carbon").textContent = `${Intl.NumberFormat([],{ minimumFractionDigits: 3, maximumFractionDigits: 3}).format(carbon)} gCO2e`;
this.store?.setItem("carbonara", JSON.stringify({transfer, duration: this.duration}));
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@digital4better/carbonara",
"version": "1.1.0",
"version": "1.1.1",
"description": "A carbon footprint web component",
"repository": {
"type": "git",
Expand Down

0 comments on commit e999824

Please sign in to comment.