decimals for resource pricing https://www.softaculous.com/board/index.php?tid=17595 <![CDATA[decimals for resource pricing]]> https://www.softaculous.com/board/index.php?tid=17595&tpg=1#p58358
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
]]>
Mon, 09 Sep 2024 19:29:30 GMT https://www.softaculous.com/board/index.php?tid=17595&tpg=1#p58358
<![CDATA[decimals for resource pricing]]> https://www.softaculous.com/board/index.php?tid=17595&tpg=1#p58233
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]]>
Mon, 29 Jul 2024 15:19:08 GMT https://www.softaculous.com/board/index.php?tid=17595&tpg=1#p58233
<![CDATA[decimals for resource pricing]]> https://www.softaculous.com/board/index.php?tid=17595&tpg=1#p58100
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.]]>
Tue, 25 Jun 2024 04:33:57 GMT https://www.softaculous.com/board/index.php?tid=17595&tpg=1#p58100
<![CDATA[decimals for resource pricing]]> https://www.softaculous.com/board/index.php?tid=17595&tpg=1#p57884
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.]]>
Wed, 24 Apr 2024 15:47:47 GMT https://www.softaculous.com/board/index.php?tid=17595&tpg=1#p57884
<![CDATA[decimals for resource pricing]]> https://www.softaculous.com/board/index.php?tid=17595&tpg=1#p52449
We have replied in your ticket and provide few files and now you can add up to 3 decimals.]]>
Tue, 30 Mar 2021 06:50:02 GMT https://www.softaculous.com/board/index.php?tid=17595&tpg=1#p52449
<![CDATA[]]> https://www.softaculous.com/board/index.php?tid=17595&tpg=0#p52442
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]]>
Mon, 29 Mar 2021 15:25:32 GMT https://www.softaculous.com/board/index.php?tid=17595&tpg=0#p52442