Sign in to follow this  
Followers 0
ray306

Currency Format in an input control

2 posts in this topic

Hi:

Does anyone now how to set up an input box to accept currency as the input.

I've set one of the constraints to number which of course precludes the period (ie. $5.00)

I can easily do error checking on the data but it would be so much easier to have the input accept only

currency values.

Any ideas

Thanks

Ray

Share this post


Link to post
Share on other sites



MsgBox(64, 'Info', _InputAmerican())

Func _InputAmerican()
    Local $sValue = ''
    Do
        $sValue = InputBox('Currency Only', 'Insert only American Currency Below', '', '', 200, 80)
    Until StringRegExp($sValue, '^\$*\d+(?:\.\d{0,2})?$')
    Return Number(StringReplace($sValue, '$', ''))
EndFunc


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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