Numeral.js in format masking

Opensearch Dashboards 1.3 on AWS Elastic Search Service.

In OpenSearch Dashboards, in the scripted fields reference documentation about number type formatting (the link provided is Numeral.js), the documentation states that you can create a mask/formatting of a number data type as I highlighted in red in the attached image.

  • I’ve tryied several times to reproduce this (as stated in the official documentation provided) and it doesn’t work.
  • I am trying to add zeroes to the left of a number type field without success.
  • i.e.: 100.23 to 00100.23 - 0.1 to 001.1

Thanks

I was able to verify this on OpenSearch Dashboards v2.4.0. The Numerals.js used by OpenSearch Dashboards is v2.0.6 and one is based on v1.5.3 which is ancient. I will experiment to see if that solves this problem and I will raise a PR for it.

i was been able to bump the Numeral library to have it show the prefixed numbers correctly and solve a few other issues. Sadly though, it introduces a bunch of other bugs. I am working on solving them.