parent
ed289682b8
commit
c5c7acb370
7 changed files with 49 additions and 7 deletions
@ -0,0 +1,9 @@ |
|||||||
|
.giveMeEllipsis { |
||||||
|
overflow: hidden; |
||||||
|
text-overflow: ellipsis; |
||||||
|
display: -webkit-box; |
||||||
|
-webkit-box-orient: vertical; |
||||||
|
-webkit-line-clamp: 2; /* number of lines to show */ |
||||||
|
/* line-height: 1; /* fallback */ |
||||||
|
/* max-height: 1*2; fallback */ |
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
const separate = (number) => { |
||||||
|
number += ""; |
||||||
|
number = number.replace(",", ""); |
||||||
|
let x = number.split("."); |
||||||
|
let y = x[0]; |
||||||
|
let z = x.length > 1 ? "." + x[1] : ""; |
||||||
|
let rgx = /(\d+)(\d{3})/; |
||||||
|
while (rgx.test(y)) y = y.replace(rgx, "$1" + "," + "$2"); |
||||||
|
return y + z; |
||||||
|
}; |
||||||
|
|
||||||
|
export default separate; |
Loading…
Reference in new issue