I have a number field created with JetEngine. I want a number such as 250,000 to be shown on the front end as 250K, 500K, etc. How do I achieve this?
Below is how it is currently shown on front end.
Dynamic Meta: {je_slots_slot-value}
I have a number field created with JetEngine. I want a number such as 250,000 to be shown on the front end as 250K, 500K, etc. How do I achieve this?
Below is how it is currently shown on front end.
Dynamic Meta: {je_slots_slot-value}
You could create a custom function that takes the custom field value and runs round()
or such PHP function on it and returns the string in your desired format. Then call that function using the {echo:functionname}
dynamic tag.
Thanks for the reply.
Thanks for the response. However, I have almost zero knowledge of PHP. I can read a code to understand its function but can’t write one. Could you please help in that regard?
Ok, so just to make sure. You have both these cases:
I see two possible solutions:
You could also write a custom PHP function that would format these values, but let’s leave that for now. Let me know if there are some reasons why my two propositions won’t work for you
I will not be using these fields for anything else like calculations, so I guess I will go with the text field approach where I would have to enter the values like you suggested. Thanks for helping