Difference between revisions of "Number Inline Expressions"

From MSX - Wiki
Jump to navigation Jump to search
(Created page with "It is possible to convert numbers (indicated in milliseconds) with inline expressions into date, time, or duration values. The expressions are similar to the live inline expre...")
 
Line 1: Line 1:
It is possible to convert numbers (indicated in milliseconds) with inline expressions into date, time, or duration values. The expressions are similar to the live inline expressions and look like this: <code>{num:{NUMBER}:{TYPE}:{FORMAT}}</code>. For more information about the live inline expressions, please see [[Live Inline Expressions]]. This feature is available since version '''0.1.91'''.
+
It is possible to convert numbers (indicated in milliseconds) with inline expressions into date, time, or duration values. The expressions are similar to the live inline expressions and look like this: <code>{num:{NUMBER}:{TYPE}:{FORMAT}}</code>. For more information about the live inline expressions, please see [[Live Inline Expressions]]. It is also possible to add colored values with the expression syntax <code>{txt:{COLOR}:num:{NUMBER}:{TYPE}:{FORMAT}}</code>. This feature is available since version '''0.1.91'''.
 
Please see following example.
 
Please see following example.
  

Revision as of 11:26, 18 January 2021

It is possible to convert numbers (indicated in milliseconds) with inline expressions into date, time, or duration values. The expressions are similar to the live inline expressions and look like this: {num:{NUMBER}:{TYPE}:{FORMAT}}. For more information about the live inline expressions, please see Live Inline Expressions. It is also possible to add colored values with the expression syntax {txt:{COLOR}:num:{NUMBER}:{TYPE}:{FORMAT}}. This feature is available since version 0.1.91. Please see following example.

Example[edit]

Screenshot[edit]

Example Screenshot (Number Inline Expressions)

Code[edit]

{
    "type": "pages",
    "headline": "Number Inline Expressions",
    "template": {
        "type": "separate",
        "layout": "0,0,2,3",
        "icon": "msx-white-soft:info",
        "color": "msx-glass"
    },
    "items": [{
            "title": "Specific Date/Time",
            "action": "info:{num:1548335764000:date:DD, MM d, yyyy}, {num:1548335764000:time:h:mm/ampm}"
        }, {
            "title": "Current Date/Time",
            "action": "info:{num:now:date:DD, MM d, yyyy}, {num:now:time:h:mm/ampm}"
        }, {
            "title": "Colored Date/Time",
            "action": "info:{txt:msx-blue:num:1548335764000:date:DD, MM d, yyyy}, {txt:msx-blue:num:1548335764000:time:h:mm/ampm}"
        }, {
            "title": "Duration Time",
            "action": "info:{num:5640000:duration:time:hh:mm:ss}"
        }, {
            "title": "Duration Text",
            "action": "info:{num:5640000:duration:text:dhms}"
        }, {
            "title": "Colored Duration",
            "action": "info:{txt:msx-blue:num:5640000:duration:text:dhms}"
        }]
}

Demo[edit]