2023-01-30 19:51:00 +01:00
|
|
|
tFormat() Netscript Function
|
|
|
|
==============================
|
|
|
|
|
2023-02-24 12:57:17 +01:00
|
|
|
.. js:function:: tFormat(milliseconds[, milliPrecision = false])
|
2023-01-30 19:51:00 +01:00
|
|
|
|
|
|
|
:RAM cost: 0 GB
|
|
|
|
|
|
|
|
:param string milliseconds: Number of millisecond to format.
|
2023-02-24 12:57:17 +01:00
|
|
|
:param boolean milliPrecision: Format time with subsecond precision.
|
|
|
|
:returns: Formatted string.
|
2023-01-30 19:51:00 +01:00
|
|
|
|
|
|
|
Format time to a readable string.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
.. code-block:: javascript
|
|
|
|
|
|
|
|
ns.print(ns.tFormat(123456789)) //logs "1 day 10 hours 17 minutes 36 seconds"
|
|
|
|
ns.print(ns.tFormat(123456789,true)) //logs "1 day 10 hours 17 minutes 36.789 seconds"
|