Hey,
today I'm releasing a small plugin that allows you to pad strings until they reach a defined length.
I wrote it because it's useful if you want to display fast changing information (like CPU clock and load) on a single line while keeping the position of the text fixed.
- grimsi
REQUIREMENTS
------------
1. LCD Smartie 5.3 beta3 or newer
2. .NET Framework 4.5
INFORMATION
-----------
This small plugin allows you to pad a string with spaces until it reaches a defined length
Version
-------
1.0
Features
----------------
function1
Pads the string on the right
Usage:
$dll(stringpad,1,Hello,7) -> "Hello "
function2
Pads the string on the left
Usage:
$dll(stringpad,2,Hello,7) -> " Hello"
function20
Returns credits about the dll and its version.
Example
----------------
This is a more complex real-world example using stringpad in combination with the enallax plugin and the SB plugin to read hardware sensors:
$dll(enallax,10,$dll(stringpad,1,$dll(SB,3,10,0),4)MHz,$dll(stringpad,1,$dll(SB,3,9,0),2) C )
It will alternate between displaying the CPU clock and displaying the CPU package temp while using the stringpad plugin to keep a constant length so that
following text is not affected by the switch between the two values and also not affected when the CPU clock is going below 1000MHz.
Possible output:
"802 MHz|1 %"
"4208MHz|20%" -> fixed length
Output without stringpad:
"802MHz|1%"
"4208MHz|20%" -> different length
KNOWN BUGS AND LIMITATIONS
--------------------------
Currently none. If found, please report in the forum.
Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases
[Release] stringpad
Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo
-
- Posts: 5
- Joined: March 17th, 2018, 2:11 pm
[Release] stringpad
You do not have the required permissions to view the files attached to this post.
-
- Posts: 3
- Joined: January 30th, 2021, 7:36 pm
Re: [Release] stringpad
oh thanks for that.