3

I am fighting with a proper displaying of fraction line in label of point. I use expression of label concat ( "ID" , '\n' ,' ',' ', '\n', "up" , '\n' ,'⏤⏤⏤', '\n', "down" ) Fraction line is a font marker. The result is as follows. enter image description here

Attributes "up" and "down" are decimal numbers with presicion of "2". However, as is seen at the label, in case of number "382,10" is displayed number "382,1". If a number is e.g."382,00", at the label it is displayed "382". Is it possible to have length of fraction line driven by lenght of numerator of a fraction? Alternatively, how to set a label that the number is displayed as "382,10", i.e. always with 2 decimal numbers? I used formatting-> formatted numbers-> decimal places=2, but it doesnt work as expected.

8
  • Wait, are you asking about the fraction line, or are you asking about the decimal places?
    – Erik
    Jun 28, 2021 at 11:27
  • Either solution works for me.
    – pazelvak
    Jun 28, 2021 at 11:27
  • And what does "it doesn't work as expected" mean? Please include relevant attempts at expressions when talking about them.
    – Erik
    Jun 28, 2021 at 11:29
  • 1
    When I used formatting-> formatted numbers-> decimal places=2, I expected that the result will be displaying of 2 decimal places in every labels. It isnt true, I dont know the result of this setting. I didnt find any difference "with" or " without" setting of formatting-> formatted numbers-> decimal places=2.
    – pazelvak
    Jun 28, 2021 at 11:32
  • No, I didnt try. Now I wrote expression format_number("up",2) at checked "formatted numbers" and I tried the same at the column "decimal places" but with no result. What do I do wrong?
    – pazelvak
    Jun 28, 2021 at 11:43

1 Answer 1

4

To summarize the solution-finding process:

If you replace the simple "up" in your label with format_number("up",2), the label will contain the values of the field "up" being forced to 2 decimal places. For further details, e.g. localisation aka "how does your decimal-separator look like", have a look at the documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.