Hello,
My Html is like this:
<input class="gbTransform" type="text" name="maxdl" value=""/>
And javascript like this:
$('.gbTransform').change(function(){
var sz = $(this).val().match(/(\d+)gb/i);
if(sz.length > 1){
$(this).val(parseInt(sz[1])*1024);
}
});
What this does is when a user types 1gb it will automatically calculate into mbs (1 * 1024 = 1024) and change the input fields value.
This works fine but when user types 1.5gb
its calculates 5 * 1024
which is incorrect it should be 1.5 * 1024
Thank You.