Jump to content

price rounding

Closed 1.3.1 1.3.3

ZIZI
  • in Shop
"Number of digits after decimal point for rounding prices": 5

Doesn't work, the economics plugin shows and calculates correctly from other plugins

Share this comment


Link to comment

I figured it out:
My configuration was transferred from 2.6.1

however if you change:

  "Formatting Settings": {
    "Buy Price Format": "0.0000",
    "Sell Price Format": "0.0000",
    "Shopping Bag Cost Format": "0.0000",
    "Balance Format": "0.0000"
  },

it correctly displays only product prices, and the player’s balance is only 0.00

I propose to add additional changes to the configuration to adjust the display of the correct player balance data:

return Math.Round(Convert.ToDouble(plugin.Call(BalanceHook, player.userID)), 2);
change on =>
return Math.Round(Convert.ToDouble(plugin.Call(BalanceHook, player.userID)), 5); ///_config.RoundFormatting

 

Share this comment


Link to comment

Hi there! 
In order to achieve the Ideal number formatting that you are going for, 
You must add an "N" in the  price format in front of the zero. 
Like so: 

"Buy Price Format": "N0" -> will make your number look like this: 1,000,000
"Buy Price Format": "N1" -> will make your number look like this: 1,000,000.0
"Buy Price Format": "N2" -> will make your number look like this: 1,000,000.00
"Buy Price Format": "0" -> will make your number look like this: 1000000

N and then the number of decimal places you want essentially. 

This worked for me, I hope it works for you! 

  • Love 1

Share this comment


Link to comment
1.1m

Downloads

Total number of downloads.

5.6k

Customers

Total customers served.

81.5k

Files Sold

Total number of files sold.

1.6m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.