Jump to content

Help with decimal output


Recommended Posts

Hi all, im trying to understand what is going on in this script, im getting a value from a webpage like 8,5378 and when multiplying with any other value it ignores the decimal, so if i input 10 the output becomes 80 when it should be 85,378, any idea?

#include <IE.au3>
#include <Misc.au3>
#include <String.au3>
#include <Array.au3>

Global $oIE
Global $kr
Global $eur
Global $prop
Global $summa
Global $frame
Global $newinfo
Global $varde
Global $swe = InputBox("SEK - EUR","Skriv in EUR du vill omvadla till SEK")

$oIE = _IECreate("http://www.nordea.se/F%c3%b6retag/Utland/Valutahantering/Daglig%2bmittkurs/1528952.html",0,0)
_IELoadWait($oIE)
Sleep(1000)
$frame = _IEBodyReadText($oIE)
;MsgBox(262144,"info1",$frame)
;Sleep(2000)
$prop = _StringBetween($frame," Euroområdet EUR Euro "," ")
;_ArrayDisplay($prop, 'Default Search')
$varde = $prop[0]
;StringReplace($varde,".",",",3)
MsgBox(262144,"info1",$varde)
;MsgBox(262144,"info2",$varde)
_IELoadWait($oIE)
_IEQuit($oIE)
$eur = Int($varde, 9)
$kr = Int($swe, 9)
$summa = Int($eur*$kr, 9)
MsgBox(262144,"EUR - SEK","SEK värde i EUR per " & " " & $swe & " KR " & "är" & " " & $summa)
Link to comment
Share on other sites

#include <IE.au3>
#include <Misc.au3>
#include <String.au3>
#include <Array.au3>

Global $oIE
Global $kr
Global $eur
Global $prop
Global $summa
Global $slutsumma
Global $frame
Global $varde
Global $swe = InputBox("SEK - EUR","Skriv in EUR du vill omvadla till SEK")

$oIE = _IECreate("http://www.nordea.se/F%c3%b6retag/Utland/Valutahantering/Daglig%2bmittkurs/1528952.html",0,0)
_IELoadWait($oIE)
Sleep(1000)
$frame = _IEBodyReadText($oIE)
;MsgBox(262144,"info1",$frame)
;Sleep(2000)
$prop = _StringBetween($frame," Euroområdet EUR Euro "," ")
;_ArrayDisplay($prop, 'Default Search')
$varde = $prop[0]
$eur = StringReplace($varde,",",".",1)
$kr = StringReplace($swe,",",".",1)
MsgBox(262144,"info1",$eur & " " & $swe)
_IELoadWait($oIE)
_IEQuit($oIE)
$summa = $eur*$kr
$slutsumma = StringReplace($summa,",",".",1)
MsgBox(262144,"EUR - SEK","SEK värde i EUR per " & " " & $swe & " KR " & "är" & " " & $slutsumma)

Thanx Firefox! i forgot to actually save the stringreplace into a variable in the first place too and i noticed i tried replacing the wrong thing aswell. "blaming the headache" :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...