Sign in to follow this  
Followers 0
anixon

Currency

9 posts in this topic

When performing a subtraction say 99.64 minus .14 the result is 99.5 where as in currency format the result should be 99.50 how do I change the maths result from 99.5 to currency format including comma's where the value is 1000 or greater....

Help is always appreciated Ant.. :)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

MsgBox(0 ,"" , StringFormat("%.2f",99.64-0.14))

just change the "2" to the number of decimals you want

Edited by TheMadman

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

MsgBox(0 ,"" , StringFormat("%.2f",99.64-0.14))

just change the "2" to the number of decimals you want

Thanks for that since posting I also found the following solution which format with a 'comma' when the value is more than 1000

:)$Amt="1001.6"

$dll=DllOpen("kernel32.dll")

$GCF=DllCall($dll,"int","GetCurrencyFormat","int",0,"int",0,"str",$Amt,"int",0,"str","", "int",20)

msgbox(0,"Dll Test",$GCF[5])

DllClose($dll)

MsgBox(0 ,"" , StringFormat("%.2f",$amt))

Appreciate the help

Ant.. :party:

Share this post


Link to post
Share on other sites

Hi,

be careful with that function. It reacts on locale settings.

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

be careful with that function. It reacts on locale settings.

Mega

Which is one of the nice things about it IMHO. Just be really carefull not to pass it a number with thosands separators added

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Thanks for the replies and advice which is very much appreciated Ant.. :)

Share this post


Link to post
Share on other sites

Which is one of the nice things about it IMHO. Just be really carefull not to pass it a number with thosands separators added

Based on LatLon is yours the red car out the front or back? Ant.. :)

Share this post


Link to post
Share on other sites

It better be in the back yard behind a fence (or in the garage) and the last time I looked it wasn't red. If you tried that with Google Earth it's off by abot 60 yards.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

It better be in the back yard behind a fence (or in the garage) and the last time I looked it wasn't red. If you tried that with Google Earth it's off by abot 60 yards.

Just think what Hubble could see if it was pointing the other way now is that the Times you are reading? Ant..

Share this post


Link to post
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
Sign in to follow this  
Followers 0