เสริม clickup #7a0d5z ที่พี่ต้นขอ ทำ core function js แปลง ตัวเลขเป็น format currency ไว้ในไฟล์ corejen.js

This commit is contained in:
Pairat Sangprasert
2021-03-29 01:26:37 +07:00
parent 6e17ab7ee0
commit 7f279c71a7
2 changed files with 27 additions and 0 deletions

View File

@@ -659,3 +659,12 @@ function GetMenu(module, mymenu, menu_url){
startLoad();
AjaxGetRequest(menu_url, refresh_menu, menu_error);
}
function coreFormatPrice(value, digits) {
var currency = 0;
if (value) {
currency = (value / 1).toFixed(digits);
}
return currency.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}