Fix the thousand separator in order to copy/paste without space

This commit is contained in:
kara Diaby 2020-02-13 15:57:29 +01:00
parent cb952b3643
commit 9287188904
3 changed files with 12 additions and 1 deletions

View file

@ -11,3 +11,8 @@
.mb-4 { .mb-4 {
margin-bottom: 4 * $default-spacer; margin-bottom: 4 * $default-spacer;
} }
.numbers-delimiter {
display: inline-block;
width: 5px;
}

View file

@ -0,0 +1,6 @@
module NumberHelper
def number_with_html_delimiter(num)
# we are using the span delimiter that doesn't insert spaces when copying and pasting the number
number_with_delimiter(num, delimiter: tag.span(class: 'numbers-delimiter'))
end
end

View file

@ -35,7 +35,7 @@
- when TypeDeChamp.type_champs.fetch(:datetime) - when TypeDeChamp.type_champs.fetch(:datetime)
= c.to_s = c.to_s
- when TypeDeChamp.type_champs.fetch(:number) - when TypeDeChamp.type_champs.fetch(:number)
= number_with_delimiter(c.to_s) = number_with_html_delimiter(c.to_s)
- else - else
= format_text_value(c.to_s) = format_text_value(c.to_s)