Welcome Guest. Please Login or Register  


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



Threaded Mode | Print  

 decimals for resource pricing (5 Replies, Read 145257 times)
fhcardoso
Group: Member
Post Group: Newbie
Posts: 4
Status:
In the documentation there is an example that shows the use of more decimals, but in the interface only step=0.01 is allowed.

I managed to get around by modifying the html and placing 6 decimals.

Ideally, at least 6 decimals should be used for the hourly price.
A VPS for example $5 per month is $0.006944 per hour.

The same problem is when to define the price per resource.
The price of RAM, CPU etc ...

See the attachments;

I modified this validation in the html and managed to update the information to 6 decimals, but I'm not sure if it will correctly calculate the hourly price or if it will round to 0.01
IP: --   

decimals for resource pricing
jevingala
Group: Virtualizor Team
Post Group: Super Member
Posts: 752
Status:
Hi,

We have replied in your ticket and provide few files and now you can add up to 3 decimals.

-----------------------
Regards,
Virtualizor Team.
http://virtualizor.com/
IP: --   

decimals for resource pricing
radwebhosting
Group: NOC
Post Group: Working Newbie
Posts: 54
Status:
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.

Edited by radwebhosting : April 24, 2024, 3:49 pm

-----------------------
Rad Web Hosting - KVM VPS - Dedicated Servers - Colocation
IP: --   

decimals for resource pricing
fhcardoso
Group: Member
Post Group: Newbie
Posts: 4
Status:
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.
IP: --   

decimals for resource pricing
radwebhosting
Group: NOC
Post Group: Working Newbie
Posts: 54
Status:
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

-----------------------
Rad Web Hosting - KVM VPS - Dedicated Servers - Colocation
IP: --   

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: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
7 guests, 0 users.


All times are GMT. The time now is November 10, 2024, 6:00 pm.

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