Skip to main content
deleted 150 characters in body; edited tags
Source Link
Ganesh Sanap - MVP
  • 46.4k
  • 22
  • 31
  • 63

I'veI have created this script to calculate the number of days from today, but it returns like 20 decimals. How to round to a whole number? 

I was trying to do this using floor()floor() but I don't understand what the syntax should be like.

Current JSON code I am using:

{
    "elmType": "div", 
    "txtContent": 
 {
        "operator": "/",
        "operands": [
            {
                "operator": "-",
                "operands": [
                    "=Number('@now')",
                    "=Number('[$Date]')"
                ]
            },
            86400000
        ]
    }
}

}

I've created this script to calculate the number of days from today, but it returns like 20 decimals. How to round to a whole number? I was trying to do this using floor() but I don't understand what the syntax should be like.

{ "elmType": "div", 
"txtContent": 
 {"operator": "/",
"operands": [
{
    "operator": "-",
    "operands": [ "=Number('@now')", "=Number('[$Date]')" ]
},
86400000
]}

}

I have created this script to calculate the number of days from today, but it returns like 20 decimals. How to round to a whole number? 

I was trying to do this using floor() but I don't understand what the syntax should be like.

Current JSON code I am using:

{
    "elmType": "div",
    "txtContent": {
        "operator": "/",
        "operands": [
            {
                "operator": "-",
                "operands": [
                    "=Number('@now')",
                    "=Number('[$Date]')"
                ]
            },
            86400000
        ]
    }
}
Source Link
JJD
  • 493
  • 2
  • 6
  • 21

JSON Column formatting round to integer

I've created this script to calculate the number of days from today, but it returns like 20 decimals. How to round to a whole number? I was trying to do this using floor() but I don't understand what the syntax should be like.

{ "elmType": "div", 
"txtContent": 
{"operator": "/",
"operands": [
{
    "operator": "-",
    "operands": [ "=Number('@now')", "=Number('[$Date]')" ]
},
86400000
]}

}