fix: Display '1x' rather than '1/1x'
This commit is contained in:
parent
f0525245de
commit
26743ee05e
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user