fix bugs w/ abs/floor

This commit is contained in:
Severiano Badajoz
2020-05-28 15:55:50 -07:00
parent bde5e32d5e
commit 618c4f1a98
+3 -3
View File
@@ -48,8 +48,8 @@ export default class Truncate extends Component {
maxSize,
params,
length < lastLength
? length / 2
: Math.floor(Math.floor((length - lastLength) / 2) + lastLength),
? Math.floor(length / 2)
: Math.floor(Math.abs(length - lastLength) / 2) + lastLength,
length,
close
);
@@ -63,7 +63,7 @@ export default class Truncate extends Component {
str,
maxSize,
params,
Math.floor((lastLength - length) / 2) + length,
Math.floor(Math.abs(lastLength - length) / 2) + length,
length,
close
);