Skip Navigation

[Resolved] Format number in a view

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 1 year, 9 months ago.

Assisted by: Minesh.

Author
Posts
#2597841

Tell us what you are trying to do?
I have a number field called "Arancel". It's the price of a course edition.
I'm using a view block to show this number.

I need to show for example $ 60.000.- instead of 60000

Is there any documentation that you are following?
I found some support tickets:
https://toolset.com/forums/topic/format-the-number-with-currency-in-view/
https://toolset.com/forums/topic/comma-decimal-format-for-numbers-us-format/
https://toolset.com/forums/topic/format-number-with-commas/

but I can't figure out how to apply a shortcode in a view

Is there a similar example that we can see?

What is the link to your site?
hidden link

#2598535

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You can use the following hook to alter the output of your custom field.

wpcf_fields_slug_{your_custom_field_slug}_value_display

Where:
- Replace {your_custom_field_slug} with your custom field slug.

Or we can use custom shortcode as well.

You can add the above hook to "Custom code" section offered by Toolset.
=> https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/#adding-custom-php-code-using-toolset

you can adjust the code as per your requirement. Here is the reference ticket that might help you:
- https://toolset.com/forums/topic/how-to-display-price-using-us-dollar-format/#post-484004

If you still require further assistance you can send me admin access details and problem URL where you want to display the formatted output.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2668641

it was a challenge to understand a filter for me, he he.

But I did it!

Thanks