(cherry picked from commit a6f2db9139c4a6b01d162ccf8884fc02c874b4cf) Closes #8788pull/8787/head
parent
3da8396b7e
commit
20a8f1cbe7
@ -0,0 +1,16 @@
|
||||
|
||||
function formatPreferredWordScore(input, customFormatsLength = 0) {
|
||||
const score = Number(input);
|
||||
|
||||
if (score > 0) {
|
||||
return `+${score}`;
|
||||
}
|
||||
|
||||
if (score < 0) {
|
||||
return score;
|
||||
}
|
||||
|
||||
return customFormatsLength > 0 ? '+0' : '';
|
||||
}
|
||||
|
||||
export default formatPreferredWordScore;
|
Loading…
Reference in new issue