Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Quick question

General discussion about LCD Smartie.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo, Fast351

Post Reply
ncoop23
Posts: 3
Joined: July 4th, 2007, 5:19 am

Quick question

Post by ncoop23 »

Can I divide my display in half and center each half of a line? I have this screen
D:$NetSpDownK(1)k/s $NetDownM(1)MB
U:$NetSpUpK(1)k/s $NetUpM(1)MB

and every time the upload speed jumps from 1-9 to 10-99 it shifts everything any ideas? Basicly what I want is the speed to be dynamicaly scaleable within a 10 char space and the total to be dynamicaly scaleable in another space. Or possibly say 04.8k/s instead of 4.8k/s. The whole display shifting is bugging me.
mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Post by mattcro »

I don't think there are any scaling functions (like to have a fixed number of digits with shifting decimal place), but you can fix the total number of digits using the $Right() function. This pads out (or truncates) the input string (NetSp... in this case) to always have the required number of characters.

For my net speed display I have:

Code: Select all

D: $Right($NetSpDownK(1),$6%)  U: $Right($NetSpUpK(1),$6%)
which neatly fills up 20 character spaces (the width of my display) and allows speeds between 0.0 and 9999.9 KB/s without any jumping about. My speeds are never higher than that (I wish...) so the positioning is always maintained.

http://lcdsmartie.sourceforge.net/commands.html has info on the $Right() command toward the bottom of the page.
Post Reply