Revert changes to currencySym

This commit is contained in:
Anton 2024-03-20 13:50:12 +01:00
parent 378b34d717
commit e5fbdaa9bb
2 changed files with 4 additions and 6 deletions

View File

@ -3,9 +3,7 @@ function round(n, dp) {
var p = Math.min(dp,dp - Math.floor(Math.log(n)/Math.log(10)));
return n.toFixed(p);
}
exports = { name : "system",
get currencySym(){console.log("Warning: Currency information is deprecated");return "£"},
set currencySym(v){},
exports = { name : "system", currencySym:"£",
translate : str=>str, // as-is
date : (d,short) => short?("0"+d.getDate()).substr(-2)+"/"+("0"+(d.getMonth()+1)).substr(-2)+"/"+d.getFullYear():d.toString().substr(4,11), // Date to "Feb 28 2020" or "28/02/2020"(short)
time : (d,short) => { // Date to "4:15.28 pm" or "15:42"(short)

View File

@ -1,3 +1,3 @@
function d(a,b){void 0===b&&(b=1);return a.toFixed(Math.min(b,b-Math.floor(Math.log(a)/Math.log(10))))}exports={name:"system",get currencySym(){console.log("Warning: Currency information is deprecated");return"\xa3"},set currencySym(a){},translate:a=>a,date:(a,b)=>b?("0"+a.getDate()).substr(-2)+"/"+("0"+(a.getMonth()+1)).substr(-2)+"/"+a.getFullYear():a.toString().substr(4,11),time:(a,b)=>{var c=a.getHours(),e=a.getMinutes();(require("Storage").readJSON("setting.json",1)||
{})["12hour"]&&(c=0==c%12?12:c%12);if(b)return(" "+c).substr(-2)+":"+("0"+e).substr(-2);b="am";0==c?c=12:12<=c&&(12<c&&(c-=12),b="pm");return(" "+c).substr(-2)+":"+("0"+e).substr(-2)+"."+("0"+a.getSeconds()).substr(-2)+" "+b},dow:(a,b)=>"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")[a.getDay()].substr(0,b?3:10),month:(a,b)=>"January February March April May June July August September October November December".split(" ")[a.getMonth()].substr(0,b?3:10),number:a=>a.toString(),
currency:a=>{console.log("Warning: Currency information is deprecated");return"\xa3"+a.toFixed(2)},distance:(a,b)=>1E3>a?d(a,b)+"m":d(a/1E3,b)+"km",speed:(a,b)=>d(a/1.60934,b)+"mph",temp:(a,b)=>d(a,b)+"'C",meridian:a=>12>=a.getHours()?"am":"pm"}
function d(a,b){void 0===b&&(b=1);return a.toFixed(Math.min(b,b-Math.floor(Math.log(a)/Math.log(10))))}exports={name:"system",currencySym:"\xa3",translate:a=>a,date:(a,b)=>b?("0"+a.getDate()).substr(-2)+"/"+("0"+(a.getMonth()+1)).substr(-2)+"/"+a.getFullYear():a.toString().substr(4,11),time:(a,b)=>{var c=a.getHours(),e=a.getMinutes();(require("Storage").readJSON("setting.json",1)||{})["12hour"]&&(c=0==c%12?12:c%12);if(b)return(" "+c).substr(-2)+":"+("0"+e).substr(-2);b=
"am";0==c?c=12:12<=c&&(12<c&&(c-=12),b="pm");return(" "+c).substr(-2)+":"+("0"+e).substr(-2)+"."+("0"+a.getSeconds()).substr(-2)+" "+b},dow:(a,b)=>"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")[a.getDay()].substr(0,b?3:10),month:(a,b)=>"January February March April May June July August September October November December".split(" ")[a.getMonth()].substr(0,b?3:10),number:a=>a.toString(),currency:a=>{console.log("Warning: Currency information is deprecated");return"\xa3"+a.toFixed(2)},
distance:(a,b)=>1E3>a?d(a,b)+"m":d(a/1E3,b)+"km",speed:(a,b)=>d(a/1.60934,b)+"mph",temp:(a,b)=>d(a,b)+"'C",meridian:a=>12>=a.getHours()?"am":"pm"}