golfinhu Posted August 4, 2010 Share Posted August 4, 2010 (edited) hi people, i need help in a dumb function >.< for example: i have the value U$ 999,00 i need to divide the value by 6, 5, 4, 3 and 2 the value has to return with a comma, not point and also with two decimal places after the comma I tried to use the Round, but it did not work ... code example: $value = Number("999,00") $divides = 6 Dim $msg $msg = "" For $i = $divides To 1 Step -1 $msg = $msg & @CRLF & $i & "x " & $value / $i & @CRLF Next MsgBox(0, "Values", $msg) he would have to return: 6x 166,50 5x 199,80 4x 249,75 3x 333,00 2x 499,50 1x 999,00 if someone can help me ... thanks =) Edited August 4, 2010 by golfinhu Link to comment Share on other sites More sharing options...
tobject Posted August 4, 2010 Share Posted August 4, 2010 $msg = $msg & @CRLF & $i & "x " & StringReplace(StringFormat( "%.2f", $value / $i ),".",",")& @CRLF Link to comment Share on other sites More sharing options...
golfinhu Posted August 4, 2010 Author Share Posted August 4, 2010 $msg = $msg & @CRLF & $i & "x " & StringReplace(StringFormat( "%.2f", $value / $i ),".",",")& @CRLFthankyou so much! Link to comment Share on other sites More sharing options...
Werty Posted August 4, 2010 Share Posted August 4, 2010 This seems to work the same, saving a few bytes $msg = $msg & @CRLF & $i & "x " & StringFormat("%.2f\n", $value/$i) & @CRLF Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
golfinhu Posted August 4, 2010 Author Share Posted August 4, 2010 rss =p thanks again =D Link to comment Share on other sites More sharing options...
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