1
0
Fork 0

- fixed regex for percent numbering;

- formatted as floating points votes percentage in polls.
This commit is contained in:
cage 2020-07-13 17:27:46 +02:00
parent 923cd09d15
commit 562d023b55
3 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ color-regexp = "(?i)(\\(c\\))|(\\(r\\))" #ff0000 bold
color-regexp = "[0-9]{4}-[0-9]?[0-9]-[0-9]?[0-9]" #0000ff bold
color-regexp = "-?[0-9]+%" #ff00ff bold
color-regexp = "-?[0-9]+(.[0-9]+)?%" #ff00ff bold
color-regexp = "\*[^*]+\*" #ffff00 bold

View File

@ -263,7 +263,7 @@
(/ (db:row-votes-count option)
vote-sum)
(error () 0)))
(vote (left-padding (format nil "~a%" (* 100 rate)) 4))
(vote (left-padding (format nil "~f%" (* 100 rate)) 4))
(bar-w (truncate (* rate max-bar-width))))
(format stream "~a~a " padded-index padded-title)
(loop for i from 0 below bar-w do

View File

@ -67,7 +67,7 @@
(loop for re in color-re do
(setf res (colorize-line res re)))
(colorized-line->tui-string res)))))
(setf (rows object)
(setf (rows object)
(mapcar (lambda (text-line)
(make-instance 'line
:normal-text text-line))