• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: 2 Decimal Points

2 Decimal Points 12 years 3 weeks ago #17210

  • rsalvo
  • rsalvo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hello,

Does anyone can advise what is wrong to my code for decimal points output? This would be a benefits to others.

Here is my code below:

======================================================================

<script type="text/javascript">

function calculateText1(){

var op1=document.getElementById('Amount');

var op2=document.getElementById('Rates');

var result=document.getElementById('Buydue');

if(op1.value=="" || op1.value!=parseFloat(op1.value)) op1.value=0.00;

if(op2.value=="" || op2.value!=parseFloat(op2.value)) op2.value=0.00;

result.value=0.00;

result.value=parseInt(result.value);

result.value=parseInt(result.value)+parseInt(op1.value)*(op2.value);}

//-->
</script>


<script type="text/javascript">

function calculateText2(){


var op3=document.getElementById('Sellamount');

var op4=document.getElementById('Rate');

var result=document.getElementById('Selldue');

if(op3.value=="" || op3.value!=parseFloat(op3.value)) op3.value=0.00;

if(op4.value=="" || op4.value!=parseFloat(op4.value)) op4.value=0.00;

result.value=0.00;

result.value=parseInt(result.value);

result.value=parseInt(result.value)+parseInt(op3.value)*(op4.value);}

//-->
</script>


<script type="text/javascript">
function Cbuy(parent,child)
{
var parent_array = new Array();
// This is the default value
parent_array = ;
// All other elements
// parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;

// Get the child
var thechild = document.getElementById(child);

// Remove all other options from the select element
thechild.options.length = 0;

// What value are we looking for ?
var parent_value = parent.options[parent.selectedIndex].value;

// No value found, use the default value
if (!parent_array[parent_value]) parent_value = '';

// Set the correct length
thechild.options.length = parent_array[parent_value].length;

// Add the options
for(var i=0;i<parent_array[parent_value].length;i++)
{
thechild.options.text = parent_array[parent_value];
thechild.options.value = parent_array[parent_value];
}
}
</script>


<script type="text/javascript">
function Csell(parent,child)
{
var parent_array = new Array();
// This is the default value
parent_array = ;
// All other elements
// parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;
parent_array = ;

// Get the child
var thechild = document.getElementById(child);

// Remove all other options from the select element
thechild.options.length = 0;

// What value are we looking for ?
var parent_value = parent.options[parent.selectedIndex].value;

// No value found, use the default value
if (!parent_array[parent_value]) parent_value = '';

// Set the correct length
thechild.options.length = parent_array[parent_value].length;

// Add the options
for(var i=0;i<parent_array[parent_value].length;i++)
{
thechild.options.text = parent_array[parent_value];
thechild.options.value = parent_array[parent_value];
}
}
</script>

============================================================

And here is the website webbdynamics.com/index.php?option=com_co...cle&id=17&Itemid=122

Best regards,

Richard
Last Edit: 12 years 3 weeks ago by rsalvo. Reason: forget the link
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!