|
|
|||||||
Hi, I need to resize a picture and have to devide the width by the height and multiply the result with a fixed height. To devide I use / and mod this is working but multiply with 1.688 is dificult for me. her is the code I use this far it is a pice from a fixform script: Code: $Height = $Bitmap.Height $Width = $Bitmap.Width $dev = ($Width / $Height) $mod = ($Width mod $Height) $verh = "$dev" +"." + "$mod" ? $Width ? $height ? $verh $nwheight = 600 * $verh ? $nwheight peter |
||||||||
|
|
|||||||
Is this what your after ? $verh = CDbl("$dev" +"." + "$mod") |
||||||||
|
|
|||||||
Originally Posted By: Shawn $verh = CDbl("$dev" +"." + "$mod") ? $verh gives 1 and should be 1.688 width = 2048 and hight = 1360 With my code '$verh = "$dev" +"." + "$mod" 'I get 1.688 My problem is multiplying 600 times 1.688 the result I get is 1200 and not 1012.8 I hope You can help. Peter |
||||||||
|
|
|||||||
Try this (change 600 to 600.0): $nwheight = 600.0 * $verh |
||||||||
|
|
|||||||
Originally Posted By: Shawn Try this (change 600 to 600.0): $nwheight = 600.0 * $verh Gives 1200 |
||||||||
|
|
|||||||
What Width and Height values are you using ? |
||||||||
|
|
|||||||
Originally Posted By: Shawn What Width and Height values are you using ? width = 2048 and hight = 1360 |
||||||||
|
|
|||||||
If I run this: Code: $Height = 1360 $Width = 2048 $dev = ($Width / $Height) $mod = ($Width mod $Height) $verh = "$dev" +"." + "$mod" ? $Width ? $height ? $verh $nwheight = 600.0 * $verh ? $nwheight I get this output: 2048 1360 1.688 1012.8 |
||||||||
|
|
|||||||
I realy get this on two difrent machines I am at work now and at home I have the same result. Dutch windows XP SP2 (work) Duch Vista (Home) 2048 1360 1.688 600 I am realy confused???? |
||||||||
|
|
|||||||
Quote: .... I am realy confused???? So am I. I get the same results as you are getting. Tried some stuff but keep getting the same results. |
||||||||
|
|
|||||||
Mart, I have been strugeling with this for about 24 hours can not sleep anymore. Uitdaging?? Peter |
||||||||
|
|
|||||||
Mart, Shawn, It has something to do with the country settings it is now on VS and I get the result from shawn. Is this a bug? Peter |
||||||||
|
|
|||||||
Quote: .... Uitdaging?? .... LOL nope. Enough work for now. This country setting….what did you change exactly to get the results Shawn is getting? |
||||||||
|
|
|||||||
Mart, I put the countrysettings "Landinstellingen" from "Nederlands" to "Engels(Verenigde Staten)" Nothing more. Sorry for the Dutch part It is dutch Win XP SP2 Peter |
||||||||
|
|
|||||||
Hmmmm... will do some tests at home tonight. If it really comes down to that simple setting that would be a little FUBAR. |
||||||||
|
|
|||||||
I can confirm this. If I change decimal symbol (Regional and Language Options -> Regional Options -> Customize -> Numbers) from a dot to a comma, I get the results as Peter. If it's a dot I get the same results as Shawn. Who's going to report this bug? |
||||||||
|
|
|||||||
there we go again, europe vs the rest dots vs comma's kilometers vs miles english vs engrish Anyway, you can keep the country settings for Dutch, just change the decimal symbols. |
||||||||
|
|
|||||||
Originally Posted By: DrillSergeant Who's going to report this bug? Shawn, Mart, DrillSergeant?? I am just a member with less then 200 posts |
||||||||
|
|
|||||||
Quote: .... I am just a member with less then 200 posts So what? 1 post or 15.000 doesn't matter. We are all equal although some are a bit more equal the others See: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=177754&page=0#Post177754 |
||||||||
|
|
|||||||
Originally Posted By: Mart So what? 1 post or 15.000 doesn't matter. We are all equal although some are a bit more equal the others LOL those are called operators |
||||||||
|
|
|||||||
this "feature" has been in kix forever. not really bug... |
||||||||
|
|
|||||||
So just to recap (and for everyone's understanding (like mine)) ... This works fine in all languages: $Value = 1.123 Because the decimal is a "built-in" feature of Kixtart. But using a string, like this: $Value = CDbl("1.123") Works over here cause we use the decimal but in Dutch - the decimal is a comma and should be: $Value = CDbl("1,123") ??? Eh ? -Shawn |
||||||||
|
|
|||||||
In a nutshell Not just Dutch, but whole of europe (minus UK) |
||||||||
|
|
|||||||
Okay, case solved. Don't use a string like that. |