Here and there in the config file or in the UI, you will have to configure durations or delays. They can be expressed in milliseconds, seconds, minutes, hours, days or years. Here are a few examples:
250ms a quarter of a second30s 30 seconds5m 5 minutes1h one hour3d three days1y one yearNotes:
90s. You cannot write 1m30s or 1.5mSome grabbers, or even conkw itself, may need credentials. See this dedicated page to figure how to make them available to conkw.
WARNING: Number formatting isn't today at a level I think would be acceptable. This is going to change at some point. The good news is that since the actual formatting is just a list of keywords, backward compatibility will be trivial so you can use whatever is in there knowing it will be supported for a long time.
Number formatting is expressed by a keyword in the directive of an expression. That's when you need your expression to be formatted, not to be used as a number of course.
Here I will just list the keywords that actually exists and a few usage examples
Note that in order to test this formatting by yourself, you can just open any ConkW page, press F12, open the console and type ConkW.getProperLabel("datarate",100) where the first argument is the keyword and the second one is the value you want to format.
As a last note, be aware that some of these formattings output a space padded string to provide easily aligned numbers. They are meant to be displayed in a cw-label that has a CSS of white-space: pre,
size Data size (HDD, RAM, etc.), on 6 characters
1.1 -> 1.10B 1024 -> 1.00KB10241254745 -> 9.54GBdatarate Data rate per second, 8 characters
10241254745 -> 9.54GB/s1024 -> 1.00KB/s100 -> 100.B /stemp Temperature in °C
1024 -> 1024°Cwtemp Temperature in °
10 -> 10°cpu Percentage of CPU usage, 4 characters. Should be between 0 and 100.
10 -> 10.0%1 -> 1.00%100 -> 100.%prc Alias for cpuprc01 Same as prc but the input is between 0 and 1.
0.01 -> 1.00%1 -> 100.%0.1 -> 10.0%stockchangeprc Percentage with a sign in front, not constant length. 1 means 100%.
-0.1 -> -10.00-3 -> -300.000.123 -> +12.30stockchange Same as stockchangeprc except the input is not divided by 100.
-0.1 -> -0.10-3 -> -3.000.123 -> +0.12time Display a duration in readable form from a number of seconds
1 -> 1s65 -> 1m 5s123456 -> 1d 10h 17m 36stime_ms Same as time but divides the input by 1000 before proceeding.
10 -> 0s1000 -> 1s65000 -> 1m 5s123456000 -> 1d 10h 17m 36stime_ns Same as time_ms but divides the input by 1000000000 before proceeding (nanoseconds).time_small_ns Takes a number of nanoseconds and display it as a number of milliseconds with 6 digits. After 1e12, number get truncated and the display is erroneous.
1000 -> 0.0010ms1231000 -> 1.2310ms1.23e9 -> 1230.0ms1000 -> 0.0010msload Output the number, padded on the right with spaces to a 5 chars long string. Works with positive numbers below 100. Spaces are represented with _ for better readability.
1 -> 1____1.2 -> 1.2__1.2356 -> 1.23610.2356 -> 10.24100.2356 -> 100.236rpm Format the number as an int padded on the keft in a 4 char string and append rpm to it. Works with numbers below 10k. Spaces are represented with _ for better readability.
1000 -> 1000_rpm1 -> ___1_rpm1.23456 -> ___1_rpm10000 -> 10000 rpmrawint Output the int representation of the number, rounded.
1123456.8 -> 11234571123.8 -> 1124hhmm Converts a number of minutes to a "HH:MM" label. Turns out it also works to convert a number of seconds to a "MM:SS" label and is used as such to display spotify times.
60 -> 01:0065 -> 01:0512 -> 00:125341 -> 89:01tstohhmmss Extract the hour, minute and second of a millisecond timestamp and format it accordingly
1624784665944 (The result of Date.now() in my browser at the time of this writing) -> 11:04:251612032547850 -> 19:49:07tstohhmm Same as above, without the seconds.
1624784665944 (The result of Date.now() in my browser at the time of this writing) -> 11:041612032547850 -> 19:49tsstohhmm Same as above but with a timestamp in seconds.
1624784665 -> 11:041612032547 -> 19:49tsstoh Extract the hour part of a timestamp in seconds
1624784665 -> 11h1612032547 -> 19h1624774665 -> 8htstodow Extract the day of the week part of a timestamp in milliseconds, in English.
1624784665944 (The result of Date.now() in my browser at the time of this writing) -> Sunday1612032547850 -> Saturdaytsstodow Extract the day of the week part of a timestamp in seconds, in English.
1624784665 -> Sunday1612032547 -> Saturdaytsstodow3 Same as above but only returns the first three characters.
1624784665 -> Sun1612032547 -> Sattsstodate Extract the date part of a timestamp in seconds, in the format YYYY-MM-DD
1624784665 -> 2021-06-271612032547 -> 2021-01-30tstodate Same as above with a timestamp in milliseconds
1624784665944 (The result of Date.now() in my browser at the time of this writing) -> 2021-06-271612032547850 -> 2021-01-30tsstodatetime Extract the date and time part of a timestamp in seconds, in the format YYYY-MM-DD HH:MM
1624784665 -> 2021-06-27 11:041612032547 -> 2021-01-30 19:49tstodatetime Same as above with a timestamp in milliseconds
1624784665944 (The result of Date.now() in my browser at the time of this writing) -> 2021-06-27 11:041612032547850 -> 2021-01-30 19:49si Make the number fit in a 5 char string, by appending a SI prefix if needed. Only works for big numbers (>1). Pad with a space if needed (represented below as a _)
0.00000001 -> 0.00_115 -> 115._123456789 -> 123.M1024 -> 1.02KcurrencyBig Use the si formatting, with up to 5 significant digits, two decimal places, right-padded in a 8 char string. Spaces are represented as _.
1000 -> 1000.00_10000 -> __10.00k12.354 -> __12.35_1000000000 -> 1000.00Myesno
1 -> YesNoA Metric is deemed to be in an error state if it respect some rule that has been defined in the ``
TBD