Support Forums

Questions about surveying? How does this thing work? We're here to help!

The Forums are now closed, because much of the older info is out of date.

Check out our Knowledge Base, ask a support question: Support.SurveyGizmo.com or ask a sales question with our Sales Contact Form.

Current User: Guest

New auto format options

Topic Locked
UserPost

6:24
September 30, 2008


gvlx

New Member

Lisboa, Portugal

posts 1

Currency format for Europe is different (in this case – Portugal – the format is “000 000 000,00″).

How can I change the javascript code to make the change?

I think this code would work but I cannot test it:

//<![CDATA[
function sgjsFormatCurrency(event){
if(typeof event == “undefined”){event = window.event;}
var target = getEventTarget(event);

if(target.value == “”)return;
num = (new String(target.value)).replace(‘€’,”);
num = (new String(num)).replace(‘ ‘,”);
num = (new String(num)).replace(‘,’,’.’);
if(isNaN(num))num = “0″;

sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();

if(cents<10) cents = “0″ + cents;

for (var i = 0; i

10:15
September 30, 2008


Chad

Admin

posts 776

Hi gvix,

This is actually a known bug.  It has been fixed in the next Version of SurveyGizmo, but the server side validation for this cannot be fixed in our current version.


If you want to replace our javascript function with your own you can just add it to the bottom of Edit Survey->Look & Feel-> This Theme's HTML Template using the same function name.


In your case just add:

function sgjsFormatCurrency(event){YOUR CODE}


Hope this helps,

Chad

Did this answer help? Let us know!
Want to be a SurveyGizmo ninja? Learn here!



The Forums are now closed, because much of the older info is out of date.

Check out our Knowledge Base, ask a support question: Support.SurveyGizmo.com or ask a sales question with our Sales Contact Form.