Small bug fixes convertDistance
This commit is contained in:
parent
109f99c7c6
commit
61ddfa4977
@ -131,7 +131,7 @@ function convertDistance (firstValue, unitFirstValue, unitFinalValue) {
|
|||||||
// Conversion des longueurs :
|
// Conversion des longueurs :
|
||||||
let difference = index1 - index2;
|
let difference = index1 - index2;
|
||||||
let result = firstValue*Math.pow(10,difference);
|
let result = firstValue*Math.pow(10,difference);
|
||||||
let response = 'Conversion de longueur : ' + firstValue.toString() + ' ' + unitFirstValue + ' = ' + formatNumberResult(result) + ' ' + unitFinalValue;
|
let response = 'Conversion de longueur : ' + formatNumberResult(firstValue).toString() + ' ' + unitFirstValue + ' = ' + formatNumberResult(result) + ' ' + unitFinalValue;
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -110,7 +110,8 @@ $(function () {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
let result = convertDistance(parseFloat(firstValue), unitFirstValue, secondValue);
|
firstValue = parseFloat(firstValue.replace(/\s/g,''));
|
||||||
|
let result = convertDistance(firstValue, unitFirstValue, secondValue);
|
||||||
if(result === messageError)
|
if(result === messageError)
|
||||||
{
|
{
|
||||||
$('.results').html(messageError);
|
$('.results').html(messageError);
|
||||||
|
Reference in New Issue
Block a user