Jump to content

Currency Format in an input control


Recommended Posts


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



Link to comment
Share on other sites

  • Moderators

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

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

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.

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

  • Recently Browsing   0 members

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