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
Math plugin
Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo
-
- Plugin Author
- Posts: 1604
- Joined: February 13th, 2005, 7:38 pm
- Location: Athens - Greece
- Contact:
Math plugin
New Plugin! math functions. This plugin makes most of the math functions you 'll need!
Get it on my site www.eserver.gr
Get it on my site www.eserver.gr
Last edited by limbo on September 24th, 2006, 4:10 pm, edited 1 time in total.
-
- Posts: 16
- Joined: September 21st, 2006, 7:56 am
Nice... Some other features that would be useful.
1. A parameter that allows you to apply rounding/precision directly to the output so you don't have to double wrap values.
2. Convert common computer values IE Bytes, Bits, Mbytes, Mbits etc. Also have these conversion functions directly part of the call so when a value has math done on it the output can be put out in the format that best fits display.
1. A parameter that allows you to apply rounding/precision directly to the output so you don't have to double wrap values.
2. Convert common computer values IE Bytes, Bits, Mbytes, Mbits etc. Also have these conversion functions directly part of the call so when a value has math done on it the output can be put out in the format that best fits display.
-
- Plugin Author
- Posts: 1604
- Joined: February 13th, 2005, 7:38 pm
- Location: Athens - Greece
- Contact:
lazybones wrote:Nice... Some other features that would be useful.
1. A parameter that allows you to apply rounding/precision directly to the output so you don't have to double wrap values.
2. Convert common computer values IE Bytes, Bits, Mbytes, Mbits etc. Also have these conversion functions directly part of the call so when a value has math done on it the output can be put out in the format that best fits display.
maybe I'll come back with a new version soon.
need help with coding yet again
first of all what do I need to run this plugin? Dotnet 1-3 or a VB library file?. so I'm trying to convert Temperature C>F and for the NVtemp plugin and I don't know what to type in the screen boxes so far I've tried and I get errors on both the first one I tried says "No Conversion Type Error" and the second one says cannot load plugin Thanks to all that help
Code: Select all
$dll(math,19,C>F$dll(nvtemp,1,1,145,) and $dll(math $dll(nvtemp,1,1,145),100,C>F,)
-
- Plugin Author
- Posts: 1604
- Joined: February 13th, 2005, 7:38 pm
- Location: Athens - Greece
- Contact:
Re: need help with coding yet again
I know you found the solution but this post is a notification for any other user.FormatC: wrote:so far I've triedCode: Select all
$dll(math,19,C>F$dll(nvtemp,1,1,145,) and $dll(math $dll(nvtemp,1,1,145),100,C>F,)
Both lines above are wrong!
$dll(math,19,C>F$dll(nvtemp,1,1,145,) = missing one comma seperator after the "C>F" which is in wrong place (it must be on the last parameter)
Correct is $dll(math,19,$dll(nvtemp,1,1,145,),C>F)
$dll(math $dll(nvtemp,1,1,145),100,C>F,) = missing the function number (19) with a comma seperator after the math keyword and the nvtemp plugin calling must be placed on the 100 position which is a not needed value. One last error is the last comma seperator
Correct is $dll(math,19,$dll(nvtemp,1,1,145,),C>F)
-
- Plugin Author
- Posts: 1604
- Joined: February 13th, 2005, 7:38 pm
- Location: Athens - Greece
- Contact:
-
- Posts: 14
- Joined: March 7th, 2007, 5:21 pm
seems its the decimalseperator thats , in my region, this little snip I found handles it.
Code: Select all
public static double StringToDouble(string stringNum) {
string decimalCharacter = System.Globalization.CultureInfo.InstalledUICulture.NumberFormat.NumberDecimalSeparator;
stringNum = stringNum.Replace(".", decimalCharacter);
stringNum = stringNum.Replace(",", decimalCharacter);
try {
return double.Parse(stringNum);
}
catch (Exception ex){
throw ex;
}
}
-
- Forum Supporter
- Posts: 590
- Joined: March 8th, 2006, 1:58 pm
- Location: Scotland
This is where things get complicated...
You can feed the result of one plugin into another plugin, or the same plugin again.
You can use the math plugins to to the divide, and place that division operation inside a call to the math plugin to round the result to 2 decimal places (for example)
IIRC function 4 is division and function 11 is round, so something like this would turn a perf plugin result in MB into the nearest whole GB value (thinking back to the total free disk space question!):
You'll need to insert the entire perf plugin string where I've put "perf,..."
So you'll end up with perhaps 3 plugin calls "nested" together! I don't know if there's a more compact way of doing it...
You can feed the result of one plugin into another plugin, or the same plugin again.
You can use the math plugins to to the divide, and place that division operation inside a call to the math plugin to round the result to 2 decimal places (for example)
IIRC function 4 is division and function 11 is round, so something like this would turn a perf plugin result in MB into the nearest whole GB value (thinking back to the total free disk space question!):
Code: Select all
$dll(math,11,$dll(math,4,$dll(perf,....),1024),0)
So you'll end up with perhaps 3 plugin calls "nested" together! I don't know if there's a more compact way of doing it...