Welcome Guest. Please Login or Register  


You are here: Index > Virtualizor - Virtual Server Control Panel > Bugs > Topic : decimals for resource pricing



Normal Mode | Print  

decimals for resource pricing
fhcardoso
Group: Member
Post Group: Newbie
Posts: 4
Status:
Quote From : radwebhosting July 29, 2024, 3:19 pm
Quote From : fhcardoso June 25, 2024, 4:33 am
Quote From : radwebhosting April 24, 2024, 3:47 pm
I also agree since the resources are calculated in 1 GB integrals at hourly integrals. In USD, a 10GB storage would be $7.30/mo when based on the least possible assigned cost $0.001 during a month that has ~730 hours.

Now, we would much prefer to charge our users less for this amount of disk.

I imagine there might be other currencies also, where 3 decimal places is unsuitable.


I created my own solution by changing the template and the database. Let me know if you are interested, I can share it with you.


Sorry for late response. Yes, it sounds very interesting and would like to know more



I'm sorry for taking so long to respond, but I hadn't seen your response.


The solution is very simples and work fine:
MAKE BACKUP OF FILES BEFORE DOING THIS.

Code
**** CHANGE THE DATABASE VIRTUALIZOR
ALTER TABLE `usage` CHANGE `h_used` `h_used` DECIMAL(10,6) NOT NULL DEFAULT '0.00' COMMENT 'The estimated amount that will be charged for the VPS';
ALTER TABLE `pricing` CHANGE `h_rate` `h_rate` DECIMAL(10,6) NOT NULL, CHANGE `m_rate` `m_rate` DECIMAL(10,2) NOT NULL, CHANGE `y_rate` `y_rate` DECIMAL(10,2) NOT NULL;

**** "ADMIN TEMPLATE CHANGE TO ALLOW STEP=0.000001"
sed -i 's/step="0.001"/step="0.000001"/g' /usr/local/virtualizor/enduser/themes/default/admin/resource_pricing_theme.php
sed -i '/prow += "<input type=\\"number\\" step=\\"0.001\\" class=\\"form-control\\" name=\\""+ratetypes\[i\]/ s/step=\\"0.001\\"/step=\\"0.000001\\"/' /usr/local/virtualizor/enduser/themes/default/admin/addplan_theme.php
sed -i '/prow += "<input type=\\"number\\" step=\\"0.001\\" class=\\"form-control\\" name=\\""+ratetypes\[i\]/ s/step=\\"0.001\\"/step=\\"0.000001\\"/' /usr/local/virtualizor/enduser/themes/default/admin/editplan_theme.php
IP: --   


Threads
 fhcardoso   decimals for resource pricing (6 Replies, Read 336225 times)
    |--  jevingala   Hi, We have...   on March 30, 2021, 6:50 am
    |--  radwebhosting   I also agree...   on April 24, 2024, 3:47 pm
    |--  fhcardoso   I also agree...   on June 25, 2024, 4:33 am
    |--  radwebhosting   I also agree...   on July 29, 2024, 3:19 pm
    |--  fhcardoso   I also agree...   on September 9, 2024, 7:29 pm
    |--  transcom99   This works fine,...   on January 8, 2025, 3:39 pm

« Previous    Next »

Normal Mode | Print  



Users viewing this topic
1 guests, 0 users.
1


All times are GMT. The time now is July 30, 2025, 2:45 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 10  |  Page Created In:0.332