Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Intro Black Friday Offer for a lifetime*

[SOLVED] Format a field as currency

  • ANIMEE
  • ANIMEE
  • OFFLINE
  • Posts: 22
  • Thanks: 0
  • Karma: 0
6 years 1 month ago - 5 years 4 months ago #307835 by ANIMEE
[SOLVED] Format a field as currency was created by ANIMEE
Hi all,

I need to format a field as currency (ex.: 100.000.000€) at least as display not so much as edit. How can I do it?

I put in the "Profile Value Layout" - [value]€ And the result is 100000000€ but there's any way to add the period (.)?

Thanks for the help
Last edit: 5 years 4 months ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48554
  • Thanks: 8292
  • Karma: 1445
6 years 1 month ago #307845 by krileon
Replied by krileon on topic Format a field as currency
We've no support for field masks (formatting for text inputs). You'll probably need to use a text field for the edit display then use a Code field using CB Code Field and custom PHP for the profile display to format it as a currency.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • ericmuc
  • ericmuc
  • OFFLINE
  • Posts: 390
  • Thanks: 30
  • Karma: 2
  • Add-ons
5 years 7 months ago #311766 by ericmuc
Replied by ericmuc on topic Format a field as currency
Hello Krileon,
do you have a documentation please, how I can do this: "You'll probably need to use a text field for the edit display then use a Code field using CB Code Field and custom PHP for the profile display to format it as a currency."?
Thanks!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48554
  • Thanks: 8292
  • Karma: 1445
5 years 7 months ago #311767 by krileon
Replied by krileon on topic Format a field as currency
No, we don't provide any sort of documentation for custom coding like that. Basically you'll be using 2 fields. 1 is the text field where they input whatever they want. The other is a code field provided by CB Code Field. In that code field you'd substitute in the value of the text field (e.g. [FIELD_NAME]) and run it though whatever PHP you like to format it however you like.

If you still want input masking, which is just JS, then you'll need to try and output your custom JS using CB Auto Actions on the before profile edit and before registration form display triggers (available in the dropdown when creating an auto action) using the Code action.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • ericmuc
  • ericmuc
  • OFFLINE
  • Posts: 390
  • Thanks: 30
  • Karma: 2
  • Add-ons
5 years 4 months ago - 5 years 4 months ago #313208 by ericmuc
Replied by ericmuc on topic Format a field as currency
Hi,
first of all, great job and good service. But with this topic I am a little bit lost. I need many price fields and would like to make searches with price limits, so I need:
1) fields with i.e: 200,00 € (stored as 200.00 €)
2) search for profiles with fields value i.e. > 150,00 €
3) calculation with the values (i.e. field 1 - field 2)
I thought this can I manage with CB and the way you described in your reply is complicate (I need one field, in which the user makes the input and sees the output in the profile).
Hopefully there is a simplier way for 1)-3), which works with CB core fields?
Thanks, best regards
Eric

add:
ah, I found: www.joomlapolis.com/forum/153-professional-member-support/213707-solved-mathematical-calculation-fields?limitstart=0
so calculations can be make, 3),
Question: can be made also with string-fields ?

add:
question: can I use a string field and put in the validation for [*,**], so that the user can only put in currency format?
Last edit: 5 years 4 months ago by ericmuc.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48554
  • Thanks: 8292
  • Karma: 1445
5 years 4 months ago - 5 years 4 months ago #313212 by krileon
Replied by krileon on topic Format a field as currency
Integer fields can't handle decimals at this time. I've already a feature ticket to improve integer fields and rename them to Number fields so it can handle decimals. Best I can suggest for now if you need decimals is a text field and custom regexp validation rule to enforce it being a currency. Below is the forge ticket were I've noted some planned improvements; likely more will be added to the ticket.

forge.joomlapolis.com/issues/7620


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 5 years 4 months ago by krileon.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum