cinatic / stocks-extension

A extension to display stock quotes in GNOME Shell Panel
GNU General Public License v3.0
84 stars 31 forks source link

number of decimal places in settings #66

Open cDonut opened 1 year ago

cDonut commented 1 year ago

Small prices are shown as $0.00 Is there some way to show current price with 4 or 5 decimal places? Can decimal places field be added to symbol settings?

luna

bhack commented 1 year ago

It is controlled at: https://github.com/cinatic/stocks-extension/blob/55490bcda8960c11c19ceec1ca92102e047fd791/stocks%40infinicode.de/helpers/data.js#L112

lon9man commented 1 year ago

@bhack i edited ~/.local/share/gnome-shell/extensions/stocks@infinicode.de/helpers to .toFixed(5)

var roundOrDefault = (number, defaultValue = '--') => isNullOrUndefined(number) ? defaultValue : (Math.round((number + Number.EPSILON) * 100) / 100).toFixed(5)

and don't see any changes..

what the steps should i to do further?

thanks!

UPD. maybe someone will need also.

var roundOrDefault = (number, defaultValue = '--') => isNullOrUndefined(number) ? defaultValue : number.toFixed(5)

to restart extension press Alt+F2, write r and Enter