Web Hosting Talk







View Full Version : Comma Problem


LooLoo
03-04-2006, 03:04 AM
Hi

I need to remove money comma. like

33.44 $ ------> 3344 $

or

33.44 $ ------> 3.344 $

in CLIENTEXEC

Plz help me.

this is the program script

<form name="accountinfo" method="post" action="signup.php" onKeyUp="highlight(event)" onClick="highlight(event)">
<input type="hidden" name="step" value="3">
<input type=hidden name=clienttype value="{CLIENTTYPE}">
<input type=hidden name=memberuserid value="0">
<input type=hidden name=domain value="{DOMAIN}">
<input type=hidden name=transfer value="{TRANSFER}">
{SIGNUPACCOUNTINFORMATIONFORMDESCRIPTION}<br>
<!-- BEGIN DYNAMIC BLOCK: boxnosubmiterror -->
{BOXNOSUBMITERROR}
<br>
<!-- END DYNAMIC BLOCK: boxnosubmiterror -->
<!-- BEGIN DYNAMIC BLOCK: packagecustomfields -->
{BOXNOSUBMIT1}
<!-- END DYNAMIC BLOCK: packagecustomfields -->
<!-- BEGIN DYNAMIC BLOCK: billinginformation -->
{BOXNOSUBMIT2}
<!-- END DYNAMIC BLOCK: billinginformation -->
<!-- BEGIN DYNAMIC BLOCK: accountinformation -->
{BOXNOSUBMIT3}
<!-- END DYNAMIC BLOCK: accountinformation -->
<!-- BEGIN DYNAMIC BLOCK: totalinfo -->
{BOXSUBMIT4}
<!-- END DYNAMIC BLOCK: totalinfo -->
<input type="hidden" name="removeArray" value="{VARQUERYSTRING}">
<input type="hidden" name="customTagsArray" value="{VARQUERYSTRING}">
<script language="javascript">
currencysymbolVAR="{CURRENCYSYMBOLVAR}";
if (document.forms['accountinfo'].elements['domainperiod']!=null) {
AddDomainPrice(document.forms['accountinfo'].elements['domainperiod']);
}
taxableVAR = {TTAXABLE};
subtotalVAR = {SUBTOTALVAR};
CalculateSubTotal();
<!-- BEGIN DYNAMIC BLOCK: gettax -->
GetTax();
<!-- END DYNAMIC BLOCK: gettax -->
</script>
</form>

LooLoo
03-04-2006, 03:06 AM
some one was send it to me...

i dont know how i must use it/

function moneyCommaSep(ctrl)
{
var separator = ",";
var int = ctrl.value.replace ( new RegExp ( separator, "g" ), "" );
var regexp = new RegExp ( "\\B(\\d{3})(" + separator + "|$)" );
do
{
int = int.replace ( regexp, separator + "$1" );
}
while ( int.search ( regexp ) >= 0 )
ctrl.value = int;
}

function removeComma(ctrl)
{
var separator = ",";

ctrl.value = ctrl.value.replace ( new RegExp ( separator, "g" ), "" );
}

Burhan
03-04-2006, 03:22 AM
33.44 $ ------> 3344 $

or

33.44 $ ------> 3.344 $

How do you know which one to change? For two same inputs (33.44) you want different output? When do you want 3.344 and when do you want 3344? Which do you want? The values are very different.

LooLoo
03-04-2006, 03:31 AM
i want change to 3.344 or 3344

not important... only i want it works right.

plz help me

LooLoo
03-04-2006, 12:15 PM
plzzzzzzzzzzzzzzzzz help meeeeeeeeeee