Problem with IF command in comment.html.twig I create a "select" field (field_points) in comment section that users rating my content and in "manage display" I set "key" for my field format.

5|Excellent
4|Good
3|No Idea
2|Bad
1|Very Bad


Now I use this code in comment.html.twig:

{% if content.field_points == 5 %}
   *****
{% elseif content.field_points == 4 %}
    ****
{% elseif content.field_points == 3 %}
    ***
{% elseif content.field_points == 2 %}
    **
{% elseif content.field_points == 1 %}
    *
{% endif %}


When I use this code nothing is displayed But when I use {{ content.field_points }} , print for example 5 ( 5 is field key ).

How can I fix this problem in drupal 8?
Use the comment entity to get the raw field value instead:

{% if comment.field_points.value == 5 %}
   *****
{% elseif comment.field_points.value == 4 %}
   ****

...

{% endif %}


This doesn't work with {{ content }}, because it contains a build array to render the fields.