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,7 +43,11 @@ let displayFunctionSlider = (value) => {
result = toLocale(transformSliderValueToPracticalValue(value)) result = toLocale(transformSliderValueToPracticalValue(value))
} else { } else {
let inverseresult = toLocale(transformSliderValueToPracticalValue(-value)) let inverseresult = toLocale(transformSliderValueToPracticalValue(-value))
result = `1/${inverseresult}` if(inverseresult == 1){
result = '1'
}else{
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,7 +53,11 @@ let displayFunctionSlider = (value) => {
result = toLocale(transformSliderValueToPracticalValue(value)) result = toLocale(transformSliderValueToPracticalValue(value))
} else { } else {
let inverseresult = toLocale(transformSliderValueToPracticalValue(-value)) let inverseresult = toLocale(transformSliderValueToPracticalValue(-value))
result = `1/${inverseresult}` if(inverseresult == 1){
result = '1'
}else{
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