Skip to content

Configuration property to allow positioning the symbol at the left or right hand side of the value#56

Closed
cattox wants to merge 2 commits intoplentz:masterfrom
cattox:master
Closed

Configuration property to allow positioning the symbol at the left or right hand side of the value#56
cattox wants to merge 2 commits intoplentz:masterfrom
cattox:master

Conversation

@cattox
Copy link

@cattox cattox commented Dec 18, 2012

This change will alllow the user to choose if he wants the symbol at the left (R$100) or right (100€) hand side of the value.

Andre Filipe Silva added 2 commits December 18, 2012 11:46
This will allow the user to select symbol location: to the left or to
the right of the value
@plentz
Copy link
Owner

plentz commented Jan 20, 2013

@cattox thank you very much for the pull request and sorry for taking so long to reply to you. unfortunally, the pull request can't be automatically merged anymore, so I will apply the changes directly in the new code after the first beta of version 2.0

personal reminder:

  • symbolLocation: use this setting to position the symbol at the left or right hand side of the value ('left'/'right')
function setSymbol(v) {
    if (settings.showSymbol) {
        if (v.substr(0, settings.symbol.length) != settings.symbol && v.substr(v.length-settings.symbol.length, v.length) != settings.symbol){
            if(settings.symbolLocation == "left"){
                return settings.symbol+v;
            } else {
                return v+settings.symbol;
            }
        }
    }
    return v;
}

@ghost
Copy link

ghost commented Jan 30, 2013

i am interested in making a negative number -$ 123 into ($ 123). it this possible?
I wish i had discovered this plug-in a year ago. saved a lot of code and time.
thank you very much.

@plentz
Copy link
Owner

plentz commented Jan 30, 2013

@mynumbercrunching that's not possible yet, but I think that it's not that hard to do. The main problem is to create a config to allow that and still be compatible with the default negative form(using -)

@plentz
Copy link
Owner

plentz commented Mar 15, 2013

related http://www.catarinamartinscard.com/jquery/maskmoney/jquery.maskMoney.js

"Só acrescentei um parâmetro 'symbolPosition' e alterei a função 'setSymbol'." by https://www.facebook.com/jccoss

@baohouse
Copy link

I actually want to have jquery-maskmoney working with jQuery Globalize. Globalize uses a currency pattern, e.g. fr-FR currency pattern is:
{ pattern: ["-n $","n $"] }
where 'n' is the value, and '$' is a generic currency symbol placeholder

It's not hard to do, so I'll probably fork the project and implement it, then do a pull request later.

@plentz
Copy link
Owner

plentz commented Jun 10, 2013

@baohouse that would be great :)

@plentz
Copy link
Owner

plentz commented Dec 25, 2013

@cattox @mynumbercrunching @baohouse @extreme-dh @rafaelkarst hey guys, I just released maskMoney 2.6.0 with the config to allow setting the position of the symbol. grab it while it's hot ;)

plentz pushed a commit that referenced this pull request Dec 28, 2013
- `symbol` ~> `prefix`
- `symbolStay` ~> `affixesStay`
- `symbolPosition` no longer exists and to put the symbol at the right, you should use `suffix`
- `affixesStay` is now default to `true`

related #56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments