We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29b2323 commit 649d5b2Copy full SHA for 649d5b2
scala-js/src/main/scala/textcounter/TextCounter.scala
@@ -13,9 +13,9 @@ object TextCounter {
13
"click",
14
(e: dom.MouseEvent) => {
15
val textInput = textContent.value
16
- val characters = textInput.length
17
- val words = textInput.trim.split("\\s+").length
18
- val lines = textInput.split("\\n").length
+ val characters = "%,d".format(textInput.length)
+ val words = "%,d".format(textInput.trim.split("\\s+").length)
+ val lines = "%,d".format(textInput.split("\\n").length)
19
textOutput.textContent =
20
s"Characters: $characters\nWords: $words\nLines: $lines"
21
}
0 commit comments