use existing function for handmoney format
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
export default function handMoney() {
|
||||
import moneyFormat from '../moneyformat';
|
||||
|
||||
export default function handMoney() {
|
||||
var currentMoney = null;
|
||||
var showMoneyChange = null;
|
||||
var difference;
|
||||
@@ -15,7 +17,7 @@
|
||||
|
||||
mp.events.add("render", () => {
|
||||
if (currentMoney != null) {
|
||||
var numberFormat = formatNumber(currentMoney);
|
||||
var numberFormat = moneyFormat(currentMoney);
|
||||
if (currentMoney >= 0) {
|
||||
mp.game.graphics.drawText("+$" + numberFormat, [0.96, 0.1],
|
||||
{
|
||||
@@ -43,7 +45,7 @@
|
||||
if (showMoneyChange <= 70) {
|
||||
alpha = (showMoneyChange * (255 / 70)) | 0;
|
||||
}
|
||||
mp.game.graphics.drawText("- $" + formatNumber(difference), [0.96, 0.145], {
|
||||
mp.game.graphics.drawText("- $" + moneyFormat(difference), [0.96, 0.145], {
|
||||
font: 7,
|
||||
color: [255, 0, 45, alpha],
|
||||
scale: [0.65, 0.65],
|
||||
@@ -57,7 +59,7 @@
|
||||
if (showMoneyChange <= 70) {
|
||||
alpha = (showMoneyChange * (255 / 70)) | 0;
|
||||
}
|
||||
mp.game.graphics.drawText("+ $" + formatNumber(nDef), [0.96, 0.145], {
|
||||
mp.game.graphics.drawText("+ $" + moneyFormat(nDef), [0.96, 0.145], {
|
||||
font: 7,
|
||||
color: [115, 186, 131, alpha],
|
||||
scale: [0.65, 0.65],
|
||||
@@ -68,8 +70,4 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function formatNumber(num) {
|
||||
return num.toLocaleString('de-DE', { minimumFractionDigits: 0 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user