changes
This commit is contained in:
@@ -176,7 +176,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
if (obj1[v] !== obj2[v]) change = true;
|
||||
});
|
||||
} else {
|
||||
for (var k in obj1) {
|
||||
for (const k in obj1) {
|
||||
if (obj1[k] !== obj2[k]) change = true;
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
// IE specific code path to prevent textarea being shown while dialog is visible.
|
||||
return clipboardData.setData("Text", text);
|
||||
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
|
||||
var textarea = document.createElement("textarea");
|
||||
const textarea = document.createElement("textarea");
|
||||
textarea.textContent = text;
|
||||
textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in MS Edge.
|
||||
document.body.appendChild(textarea);
|
||||
@@ -308,9 +308,9 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
};
|
||||
|
||||
const vnmoney = function (amount) {
|
||||
var readGroup = function (group) {
|
||||
let readDigit = [" Không", " Một", " Hai", " Ba", " Bốn", " Năm", " Sáu", " Bảy", " Tám", " Chín"];
|
||||
var temp = "";
|
||||
const readGroup = function (group) {
|
||||
const readDigit = [" Không", " Một", " Hai", " Ba", " Bốn", " Năm", " Sáu", " Bảy", " Tám", " Chín"];
|
||||
let temp = "";
|
||||
if (group == "000") return "";
|
||||
temp = readDigit[parseInt(group.substring(0, 1))] + " Trăm";
|
||||
if (group.substring(1, 2) == "0")
|
||||
@@ -324,8 +324,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
else if (group.substring(2, 3) != "0") temp += readDigit[parseInt(group.substring(2, 3))];
|
||||
return temp;
|
||||
};
|
||||
var readMoney = function (num) {
|
||||
if (num == null || num == "") return "";
|
||||
const readMoney = function (num) {
|
||||
if ($empty(num)) return "";
|
||||
let temp = "";
|
||||
while (num.length < 18) {
|
||||
num = "0" + num;
|
||||
@@ -450,22 +450,20 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
};
|
||||
|
||||
const numberToVietnamese = (input) => {
|
||||
if (input === null || input === undefined || input === "") return "";
|
||||
if ($empty(input)) return "";
|
||||
|
||||
var number = Number(input);
|
||||
let number = Number(input);
|
||||
if (isNaN(number) || number < 0 || number % 1 !== 0) return "";
|
||||
|
||||
if (number === 0) return "Không";
|
||||
|
||||
var units = ["không", "một", "hai", "ba", "bốn", "năm", "sáu", "bảy", "tám", "chín"];
|
||||
|
||||
var scales = ["", "nghìn", "triệu", "tỷ", "nghìn tỷ", "triệu tỷ"];
|
||||
const units = ["không", "một", "hai", "ba", "bốn", "năm", "sáu", "bảy", "tám", "chín"];
|
||||
const scales = ["", "nghìn", "triệu", "tỷ", "nghìn tỷ", "triệu tỷ"];
|
||||
|
||||
function readThreeDigits(num, isFull) {
|
||||
var result = "";
|
||||
var hundred = Math.floor(num / 100);
|
||||
var ten = Math.floor((num % 100) / 10);
|
||||
var unit = num % 10;
|
||||
let result = "";
|
||||
const hundred = Math.floor(num / 100);
|
||||
const ten = Math.floor((num % 100) / 10);
|
||||
const unit = num % 10;
|
||||
|
||||
if (hundred > 0 || isFull) {
|
||||
result += units[hundred] + " trăm";
|
||||
@@ -488,14 +486,14 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
return result.trim();
|
||||
}
|
||||
|
||||
var result = "";
|
||||
var scaleIndex = 0;
|
||||
let result = "";
|
||||
let scaleIndex = 0;
|
||||
|
||||
while (number > 0) {
|
||||
var chunk = number % 1000;
|
||||
let chunk = number % 1000;
|
||||
|
||||
if (chunk > 0) {
|
||||
var isFull = result !== "";
|
||||
const isFull = result !== "";
|
||||
result =
|
||||
readThreeDigits(chunk, isFull) +
|
||||
(scales[scaleIndex] ? " " + scales[scaleIndex] : "") +
|
||||
|
||||
@@ -186,8 +186,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
};
|
||||
|
||||
const findpage = function (arr) {
|
||||
var copy = $copy(store.pagetrack);
|
||||
var doFind = function () {
|
||||
const copy = $copy(store.pagetrack);
|
||||
function doFind() {
|
||||
let found = undefined;
|
||||
for (let i = 1; i <= 30; i++) {
|
||||
let name = `pagedata${i}`;
|
||||
@@ -199,7 +199,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
}
|
||||
if (!found) console.log("pagename not found");
|
||||
return found;
|
||||
};
|
||||
}
|
||||
let result;
|
||||
if (arr) {
|
||||
result = [];
|
||||
|
||||
Reference in New Issue
Block a user