2019-03-03 04:08:54 +01:00
getPurchasedServerCost() Netscript Function
===========================================
.. js:function :: getPurchasedServerCost(ram)
:RAM cost: 0.25 GB
2023-01-06 13:43:09 +01:00
:param number ram: Amount of RAM of a potential purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of :doc:`getPurchasedServerMaxRam<getPurchasedServerMaxRam>`
2021-03-12 08:51:56 +01:00
:returns: Cost to purchase a server with the specified amount of ``ram``.
2019-03-03 04:08:54 +01:00
2023-01-06 13:43:09 +01:00
Giving any non-power-of-2 as an argument results in the function returning `Infinity`
2021-03-12 08:51:56 +01:00
Example:
2019-03-03 04:08:54 +01:00
2021-03-12 08:51:56 +01:00
.. code-block :: javascript
2019-03-03 04:08:54 +01:00
2023-01-06 13:43:09 +01:00
ns.getPurchasedServerCost(8192); // returns: 450560000