Page 1 of 1
Math plugin
Posted: July 30th, 2006, 8:43 am
by limbo
New Plugin! math functions. This plugin makes most of the math functions you 'll need!
Get it on my site
www.eserver.gr
Posted: September 22nd, 2006, 3:53 am
by lazybones
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.
Posted: September 22nd, 2006, 1:38 pm
by limbo
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
Posted: April 20th, 2007, 7:58 pm
by FormatC:
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
Code: Select all
$dll(math,19,C>F$dll(nvtemp,1,1,145,) and $dll(math $dll(nvtemp,1,1,145),100,C>F,)
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
Posted: April 21st, 2007, 1:33 am
by FormatC:
Never mind I got it
Re: need help with coding yet again
Posted: April 22nd, 2007, 2:29 pm
by limbo
FormatC: wrote:so far I've tried
Code: Select all
$dll(math,19,C>F$dll(nvtemp,1,1,145,) and $dll(math $dll(nvtemp,1,1,145),100,C>F,)
I know you found the solution but this post is a notification for any other user.
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)
Posted: May 1st, 2007, 1:09 pm
by MORA
seems like it dont like double/float values ?
$dll(math,3,10,0.1) = 10

$dll(math,3,10,1) = 10
Posted: May 1st, 2007, 9:04 pm
by limbo
MORA wrote:seems like it dont like double/float values ?
$dll(math,3,10,0.1) = 10

$dll(math,3,10,1) = 10
Oops we have a bug there... I'll look on the source code ASAP
Posted: May 5th, 2007, 11:50 pm
by MORA
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;
}
}
Posted: June 20th, 2007, 2:54 pm
by riffraff
works great But is there any way to limit the accuracy of this plugin when doing division?
you example shows "parameters 2 and 3 will give a result of 0.666666666666666667"
how can i change this to give 0.67?
Posted: June 20th, 2007, 6:18 pm
by mattcro
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!):
Code: Select all
$dll(math,11,$dll(math,4,$dll(perf,....),1024),0)
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...