How to change decimal to comma for French? RESOLVED

  • AA_C
    Asked on April 27, 2016 at 12:34 PM

    Hi,

    I asked about this issue also some time ago for our French Canadian users.

    Display $2.65 English as 2,65 $ in French. 

    Just curious as to the status of this. 

    Robert

  • Kiran Support Team Lead
    Replied on April 27, 2016 at 12:41 PM

    I believe that Masked input widget can meet your requirements. Could you give it a try and let us know if that doesn't work for you?

    http://widgets.jotform.com/widget/masked_input

    Thank you! 

  • Ben
    Replied on April 27, 2016 at 2:54 PM

    Hi to both Robert and Randy :)

    At first I thought that you wanted to change position of dollar sign (in front or after the amount) Robert, but checking the previous thread and reply from Randy it seems that you are after decimal point sign - comma and dot.

    The gif looks great Randy, but (and I hope you will not mind) the commaSeparate() function is only good when displaying amounts with dot for decimal points. This is because US should look something like this 1,140,000.00 while in EU it should be 1.140.000,00

    This is however accomplished by the "Use commas for decimal point" option that you have marked on the same screenshot.

    Unfortunately there is no way to change it dynamically, you would need to pre-set the form calculation to match the layout that you wish.

    Alternatively to clone the field after setup and have one show US and the other EU style.

    This can be done by detecting language used on the form through conditions.

    For example, the following guide shows how to send different emails based on the language in conditions:

    How to change email template sent based on the language used?

    The same principle can be then applied to show different fields.

    Hope this helps.

  • AA_C
    Replied on May 10, 2016 at 9:42 AM

    Hi,

    Sorry about the long delay in getting back.

    @Ben, I was looking for the $ sign to be placed at the end and replacing the decimal point with a comma. 

    Please look my previous about this issue. Jan 4 2016, ... 

    Display $ in french format in Total ( WAITING FOR FIX )

     Thank you all,

    Robert

  • Kiran Support Team Lead
    Replied on May 10, 2016 at 11:29 AM

    Since the issue is already been looking into by our colleague, if there is any update in this regard you'll be posted on the other thread. At the moment, I see that Masked Input widget is the only workaround to display the numbers in your required format. 

    Here is the demo form with the Masked Input widget:

    https://form.jotform.com/61304974615962

    You may clone the form to your account to see the settings on the widget.

    Thanks!

  • AA_C
    Replied on May 14, 2016 at 2:30 PM

    @Kiran

    I tried your form and I don't understand how it functions. When I place a value, 456.78 or $456.78 in the Number Input box nothing happens. I was expecting the equivalent value to appear in French format, in the Number Output box. All I get is a $. What should appear is 456,78 $ 

    Can you explain how it should be working Please.

    thank you,

    Robert

  • AA_C
    Replied on May 14, 2016 at 2:46 PM

    @Randy,

    Thank you for the input. Always appreciated. French Canada uses the EU format also. I tried your suggestion some time ago without success. 

    @Ben,

    I looked at this but I'm a bit confused. It is not on an email response that I'm looking for the format, it is on the users form as they select an item. For example the French DogID application form-53464905175965.

    How to change decimal to comma for French? RESOLVED Image 1 Screenshot 20

    As you can see it displays the total in english format. 

    I think part of the problem is the PayPal settings are $CAD which assumes using a decimal point by default.

    So that is the issue. Thanks to all for your support.

    Robert

  • AA_C
    Replied on May 14, 2016 at 3:15 PM

    OH!, And one other thing of note on this form;

    When I select Oui that I am a member it uses 2 decimal points for total, when I select Non it uses 1 decimal point for total. I don't understand why?

    Perhaps this should be another thread.

    Robert

  • Ben
    Replied on May 14, 2016 at 3:38 PM

    Hi Robert,

    I would like to apologize for the confusion. What my colleague suggested would work, but only if you apply what I mentioned (I also implied on the form itself).

    That would be to set the Masked input widget (2 of them) and show one or the other based on the language.

    You can also do the same with calculation widget by setting it up as mentioned by Randy above (only the Advanced -> Use commas for decimal point).

    For payment tools, it would not be possible to do the same. Sure with some CSS we might be able to show comma over the dot at specific point, but I would not use that in a live form due to very likely possibility of comma being shown in wrong place (due to difference in browsers default font sizes, line heights, fonts in general, form and field width, etc).

    What is possible is to set your form to show the total in the form calculation and hide the payment tool (so not a lot of change would be done on the mentioned form).

    Now I think that it is best to do it and show it than explain it, so what I did was the following:

    1. Added 2 Form Calculation widgets.

    2. I set one to show the US style amount

    How to change decimal to comma for French? RESOLVED Image 1 Screenshot 40

    and the other to show it in EU style

    How to change decimal to comma for French? RESOLVED Image 2 Screenshot 51

    3. I now set conditions to show one or the other based on the language

    How to change decimal to comma for French? RESOLVED Image 3 Screenshot 62

    You can see it active on this form: https://form.jotform.com/61345830191957

    *I have left the payment processor field shown, just so that you can see the value that should be shown.You can of course hide the payment tool using this CSS:

    li.form-line[data-type="control_paypal"] {
        display: none;
    }

    Hope this helps and if you decide to use that form, please do check if the translations I made are correct - I made translations of all text that you had in order to be able to show a difference when switching language properly.

  • Ben
    Replied on May 14, 2016 at 3:42 PM

    In regards to your last question Robert, I have moved it to this thread: https://www.jotform.com/answers/839310 so that we can properly assist you with the same.

    I think that I see the issue, but want to test it out and will update you there shortly :)

  • AA_C
    Replied on May 14, 2016 at 3:45 PM

    Hi Ben,

    If you look at my form, 53464905175965 you will see I have set use comma for decimal point already.

    Your form still has a decimal for the prix total and no $ sign after the value.

    Robert

  • AA_C
    Replied on May 14, 2016 at 3:51 PM

    @Ben,

    This form is not bilingual, it is French only so there is no need for a language change.

    English Canada uses the same format as the US.

    Thanks,

    Robert

  • Ben
    Replied on May 14, 2016 at 4:30 PM

    I saw on your form that you did have the setup for comma on calcul form calculation. On the other thread I replied few moments ago I have shown you a screenshot of the same - and to avoid issues, I had unchecked the same on it.

    The reason is that you can not send comma to payment processor, or it will not see it correctly. Since you were using conditions, it seemed to work properly, but it might not have for some people.

    For example if 7,5 was passed it could have been interpreted as 75.

    Now where you should set that option is on the 'display only' form calculations - the ones I mentioned on this thread to show us the right values.

    This is what I see when changing language:

    French:

    How to change decimal to comma for French? RESOLVED Image 1 Screenshot 40

    English:

    How to change decimal to comma for French? RESOLVED Image 2 Screenshot 51

    For me, as I change the language the values are changed.

    I have now hidden the original total price field (payment processor field) using the code above.

    In regards to the language, I do apologize, based on the top:

    "Display $2.65 English as 2,65 $ in French."

    I was under the impression that you want to have both on your form.

    Since you do not, you apply basically the same steps as above, just without conditions.

    1. You set up everything to work as you want it

    2. You add a new form calculation widget set up as so:

    How to change decimal to comma for French? RESOLVED Image 3 Screenshot 62

    And you add to it the form calculation widget that you are using to pass the total (that form calculation must not use commas for decimal point), only the one that you will use to show the total.

    Then hide the payment processor total field and that is it.

    Instead of the above CSS I have used the following instead:

    li.form-line[data-type="control_paypal"] {
        display: none;
    }
    #stage li.form-line[data-type="control_paypal"] {
        display: inline-block;
        opacity:0.5;
    }

    That way we can see it as transparent in the form builder, but not on the form itself.

    You can see what I mean on a new clone of your form: https://form.jotform.com/61346841422957

    Do let us know if that is what you are after Robert.

  • AA_C
    Replied on May 14, 2016 at 4:35 PM

    Hi Ben,

    You got it that time, exactly what I wanted. Great work. I will implement it shortly.

    Thanks very much,

    Robert

  • AA_C
    Replied on May 15, 2016 at 9:22 AM

    Hi JF,

    One thing I noticed is that although "control_paypal" is now not visible to the user it still takes up space on the form and created a slight form appearance issue, so I had to relocated it to the very bottom. 

    This is a very good option, I can use this solution on all my French forms where PayPal is used.  

    You JF Guys & Gals do good work!

     

    Robert

  • David JotForm Support Manager
    Replied on May 15, 2016 at 11:14 AM

    On behalf of my colleagues, you are welcome! Open a new thread if you need anything else, we will be glad to assist you.