TOPIC:

Thousands Separator 2 weeks 5 days ago #275056

  • Topic Author
  • gateirow
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 0
Hi, I need help with the code for separate thousand in field currency

Thankyou

Please Log in or Create an account to join the conversation.

Thousands Separator 2 weeks 4 days ago #275061

  • tihana.krivic's Avatar
  • tihana.krivic
  • Away
  • Moderator
  • Moderator
  • Posts: 10535
  • Karma: 3
  • Thanks: 705
Hi,

do you have any total field or something like this, and then you want to set this field with separator?
E.g. like this you can do:
ff_getElementByName('total').value=total.toLocaleString('de-DE', {
    minimumFractionDigits: 2,
    maximumFractionDigits: 2
});
If this is confusing for you, please explain it a little better and I will help with the code :)

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Thousands Separator 2 weeks 4 days ago #275096

  • Topic Author
  • gateirow
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 0
Hi,
I have a field for "price", I need that when typing a value it separates it into thousands and millions.
Ex: $5,100,000

I also ask where the code is implemented?

Thanks

Please Log in or Create an account to join the conversation.

Thousands Separator 2 weeks 2 days ago #275110

  • tihana.krivic's Avatar
  • tihana.krivic
  • Away
  • Moderator
  • Moderator
  • Posts: 10535
  • Karma: 3
  • Thanks: 705
Hi,

I will test it and let you know how to get this :)

UPDATE:
please go to this field->Advanced->Actionscript->check Custom->check Change->and put this:
function ff_nameoelement_action(element, action)
{
    switch (action) {
        case 'change':
var test=Number(ff_getElementByName('nameofelement').value);
ff_getElementByName('nameofelement').value=test.toLocaleString('en-US', {
    minimumFractionDigits: 2,
    maximumFractionDigits: 2
});
            break;
        default:;
    } // switch
} // ff_nameofelement_action
Please replace nameofelement with name of price element :)

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.
  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.046 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!