Add interval_as_double argument to control how intervals are converted to JSON

This commit is contained in:
Tim Wojtulewicz 2024-12-03 09:15:26 -07:00
parent 8ff10e4d21
commit 43e3de5c79
5 changed files with 54 additions and 14 deletions

View file

@ -248,9 +248,12 @@ public:
* first match on any record field name in the resulting output. See the
* to_json() BiF for context.
*
* @param interval_as_double If true, interval values will be written as
* doubles instead of the broken-out version with units.
*
* @return JSON data representing the Val.
*/
StringValPtr ToJSON(bool only_loggable = false, RE_Matcher* re = nullptr);
StringValPtr ToJSON(bool only_loggable = false, RE_Matcher* re = nullptr, bool interval_as_double = false);
template<typename T>
T As() {