Support Forums : New auto format options

We encourage an open exchange of information. Ask your questions or make suggestions. We are here to help, but we also encourage all of you to help one another.
Click on the Subscribe Flag to be notified by email of replies to your post.
Current User: Guest Login Register
Please consider registering

New auto format options

Add a New Topic Reply to Post
UserPost

1: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

5:15
September 30, 2008


Chad

Moderator

posts 718

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

Add a New Topic Reply to Post


Reply to Topic: New auto format options

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 4 + 10        (Required)

Topic Reply:


 
© Simple:Press Forum - Version 3.1.4 (Build 357)