SolidOS / solid-ui

User Interface widgets and utilities for Solid
https://solidos.github.io/solid-ui/dist/solid-ui.js
MIT License
147 stars 41 forks source link

'formatter' Number Field Property #163

Open brownhoward opened 4 years ago

brownhoward commented 4 years ago

User Story

As a Form Designer, I can optionally set the formatter to apply to a number field, so I can correctly display the number.

Acceptance Criteria

  1. In a Form Model, a 'formatter' property can be optionally defined for a NumberField. For example:
    ui:formatter "####.#";
  2. When the form is rendered, the formatter is used to display the number.
timbl commented 4 years ago

Is there a standard for the format string? There is always printf which of course was blessed by being built into the python language as well. Use that -- ie "4.2d" rather than ####.## ? Got a good js library?

timbl commented 4 years ago

Maybe https://www.npmjs.com/package/sprintf-js is Bsd-3