Explanation of perspective table's columns.numberFormat

I was looking at the documentation of the Perspective table, in the columns section and the property numberFormat. That section doesn’t have any information about valid numberFormat values or what different patterns mean. I’m left to guess based on pre-configured set of options. Can you give better information about what characters and patterns in the numberFormat property are valid and what they do? If you use a common library, then a link to its documentation would be sufficient.

Originally I was trying to see if I could add a static prefix and/or suffix in the number format. For example, I could format 5 into Next 5 days with a pattern like Next 0 days. It seems that prefixes or suffixes are stripped out and have no effect, or cause the format to break. My example above just shows 5 with my custom numberFormat.

If I knew more about how numberFormat patterns are applied then I would have been able to more quickly assess whether the static prefix/suffix is possible and, if not, take another approach.

Number formatting uses http://numeraljs.com/, while date formatting uses https://momentjs.com/, throughout Perspective.


Thank you, that’s very helpful!

1 Like