z0mgItsJohn Posted September 9, 2008 Posted September 9, 2008 It Wrote It Cause I Was Bored? Script : _Math.Au3 Func _Decimal_To_Percent ($Decimal) Local $Return $Return = ($Decimal * '100') Return $Return EndFunc Func _Decimal_To_Fraction ($Decimal) Local $Return $Return = (_Decimal_To_Percent ($Decimal) & '/100') Return $Return EndFunc Func _Fraction_To_Decimal ($Fraction) Local $Return, $String_Split $String_Split = StringSplit ($Fraction, '/') $Return = ($String_Split['1'] / $String_Split['2']) Return Round ($Return, '3') EndFunc Func _Fraction_To_Percent ($Fraction) Local $Return $Return = (_Decimal_To_Percent (_Fraction_To_Decimal ($Fraction))) Return $Return EndFunc Func _Percent_To_Fraction ($Percent) Local $Return $Return = ($Percent & '/100') Return $Return EndFunc Func _Percent_To_Decimal ($Percent) Local $Return $Return = (_Fraction_To_Decimal (_Percent_To_Fraction ($Percent))) Return $Return EndFunc ~ Enjoy ~ Please Feel Free To Leave Comments, Bugs.., Etc... - John Latest Projects :- New & Improved TCP Chat
WeMartiansAreFriendly Posted September 9, 2008 Posted September 9, 2008 Why do you use strings for numbers? $Return = ($Percent & '/100') ... .. $Fraction = GUICtrlCreateInput ('','5','5','110','23','1') .. and could you explain the purpose (particularly the example) a little more. Sorry, I'm not much of a mathematician Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now