Refactor: UI & Feature updates (Calculator, UnitConverter, Privacy, Cleanup)
This commit is contained in:
@@ -162,6 +162,15 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
swapUnits() {
|
||||
const { fromIndex, toIndex } = this.data;
|
||||
this.setData({
|
||||
fromIndex: toIndex,
|
||||
toIndex: fromIndex
|
||||
});
|
||||
this.calculate();
|
||||
},
|
||||
|
||||
formatResult(val: number): string {
|
||||
if (Math.abs(val) < 0.000001 || Math.abs(val) > 10000000) {
|
||||
return val.toExponential(4);
|
||||
|
||||
Reference in New Issue
Block a user