Mikhus / canvas-gauges

HTML5 Canvas Gauge. Tiny implementation of highly configurable gauge using pure JavaScript and HTML5 canvas. No dependencies. Suitable for IoT devices because of minimum code base.
http://canvas-gauges.com/
MIT License
1.57k stars 396 forks source link

Request: Value in currency format, with commas and dollar sign #159

Closed natecope closed 5 years ago

natecope commented 6 years ago

https://imgur.com/a/tkMY4

I'd like the value of the meter to allow for commas and dollar signs, to represent currency. Is this possible? Feature request maybe?

Mikhus commented 6 years ago

It is possible to utilize valueText option while updating gauge value to set any text you want to have in value box, like:

document.gauges[0].update({ value: 15, valueText: "$15.00" })

Hope it helps.

All kind regards, Mike

On Tue, Feb 6, 2018 at 10:15 PM, Nathan Cope notifications@github.com wrote:

[image: Meter] https://camo.githubusercontent.com/4a5e055f66ad01e803e26ef512122ae20375ffb6/68747470733a2f2f696d6775722e636f6d2f612f746b4d5934

I'd like the value of the meter to allow for commas and dollar signs, to represent currency. Is this possible? Feature request maybe?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Mikhus/canvas-gauges/issues/159, or mute the thread https://github.com/notifications/unsubscribe-auth/AANxGI_pPbbI-mYltFsDONrtohQ3K2wyks5tSLLugaJpZM4R7qic .

natecope commented 6 years ago

Works great! Thanks so much!