fix: Display '1x' rather than '1/1x'

This commit is contained in:
NunoSempere 2021-11-15 13:40:20 +00:00
parent f0525245de
commit 26743ee05e
2 changed files with 10 additions and 2 deletions

View File

@ -43,8 +43,12 @@ let displayFunctionSlider = (value) => {
result = toLocale(transformSliderValueToPracticalValue(value)) result = toLocale(transformSliderValueToPracticalValue(value))
} else { } else {
let inverseresult = toLocale(transformSliderValueToPracticalValue(-value)) let inverseresult = toLocale(transformSliderValueToPracticalValue(-value))
if(inverseresult == 1){
result = '1'
}else{
result = `1/${inverseresult}` result = `1/${inverseresult}`
} }
}
result = `The first option is ${result}x as valuable as the second one` result = `The first option is ${result}x as valuable as the second one`
return result return result

View File

@ -53,8 +53,12 @@ let displayFunctionSlider = (value) => {
result = toLocale(transformSliderValueToPracticalValue(value)) result = toLocale(transformSliderValueToPracticalValue(value))
} else { } else {
let inverseresult = toLocale(transformSliderValueToPracticalValue(-value)) let inverseresult = toLocale(transformSliderValueToPracticalValue(-value))
if(inverseresult == 1){
result = '1'
}else{
result = `1/${inverseresult}` result = `1/${inverseresult}`
} }
}
result = `The first option is ${result}x as valuable as the second one` result = `The first option is ${result}x as valuable as the second one`
return result return result