Operating System: Windows 7
Bug severity: Watts, Kilowatts, Megawatts - it's all a bit untidy
This is more a quality of life report than a bug. Although I could probably make a case for values displayed as "6.7e+003KW" being a bug.
Surely it wouldn't be too difficult to create a formatting function for Watts, Kilowatts, Megawatts, Gigawatt, Terawatt, Petawatt, with an optional number of decimal places?
Right now, there's all sorts of formatting for electrical values.
- Solar panels display as 654.123W (Watts to 3 decimal places).
- Wind Turbines display as 6543.12W (Watts to 2 decimal places).
- Geothermal show as a fixed 2000W (Watts to 0 decimal places).
- Flywheel Storage displays as 6543.321KW (Kilowatts to 3 decimal places).
- Fission and Fusion Reactors display as 7654321W (Watts to 0 decimal places).
I've got to assume that if it's showing as an exponential number, it's a bug - or at least an omission.
I don't know C, C##, C++ or the like enough to do much more than embarrass myself. And you really don't want an example in COBOL. So I'll throw in some something that's sort of pseudo BASIC...
Code: Select all
function FormatWatts (inWatt, inDecPlaces) outWatt$ = "#err# W" if inWatt < 800 then outWatt$ = string (round(inWatt,inDecPlaces)) + "W" else if inWatt < 800000 then outWatt$ = string (round(inwatt/1000,inDecPlaces)) + "KW" else if inWatt < 800000000 then outWatt$ = string (round(inwatt/1000000,inDecPlaces)) + "MW" else .... .... .... end if end if end if return (outWatt$)
I picked 800 and it's multiples basically because I think numbers like 950W looks better as 0.95 KW or even 0.9 KW. Just a personal preference.
I'd even be tempted to hard code the inDecPlaces as 1. Sorry, but the constant jumping around of the display when hovering over things like Flywheels makes my brain ache, especially to 3 decimal places.
ofc, that doesn't address the localisation issues of European countries that reverse the comma and the fullstop or India where 100,000 is displayed as 1,00,000 - because after one thousand, they represent numbers as multiples of one hundred not one thousand.
Anyway, if it's not already on your things to do... 6.7e+003KW exponential numbers... ugly.