How to use split function in jquery to split a value
<p>I want to convert this php code snippet that converts/truncates a value:</p>

<p>here is the php code:</p>

<pre><code>$currentcost = 42.35;
$currentcost = explode(".", $currentcost);

if($currentcost[1] &lt;= 35) {
$currentcost[1] = 99;
$currentcost[0] -= 1;
}
echo $output = $currentcost[0] . "." . $currentcost[1]; 
</code></pre>

<p>This is supposed to be the condition:</p>

<p><strong>x.35</strong> where x is any number. If the decimal number is less than or equal to 35 then convert the .35 into 99 and subtract the x value with 1.</p>

<p>Something like this:</p>

<p>42.35 will become 41.99</p>
