0

I want to add thousand separators to the labels of the following picklist. No change should be made to the values, instead displaying text should use thousand separators.

     <aura:iteration items="{!v.myValues}" var="item">
            <option text="{!item.label+ ' km'}" value="{!item.value}"/>
     </aura:iteration>

In the list "myValues", I have values such as "300000". These are texts not integers.

Can someone help with this ?

Prasadika
  • 897
  • 2
  • 20
  • 36

1 Answers1

0

I think that you can use lightning:formattedNumber component.

Example:

<lightning:select label="Number?">
    <aura:iteration items="{!v.myValues}" var="item">
        <option value="{!item.value}">
            <lightning:formattedNumber value="{!item.label}"/> km
        </option>
    </aura:iteration>
</lightning:select>
Nobi992
  • 196
  • 1
  • 6