Skip to Content Skip to Menu

CB price field with decimal

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
10 years 7 months ago #243085 by dotcom22
CB price field with decimal was created by dotcom22
I wondering if is possible to set a simple Text or Integer field (who will be used for add a price value) with decimal. For example I would like set the field for contain only numeric value + dot. In practice if a user want set a price such "12" he can do that at least in 3 way:

1) 12
2) 12.-
3 12.00

So what I would like is to format each price value with decimal such 12.00 even if user introduced 12 or 12.-. Now of course if user set his price such 12.50 no problem in this case.

Any solution for that ? An alternative is to warn user with a tooltip comment and say they must always set their price with decimal but they can forget or just don't care.

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 7 months ago #243089 by krileon
Replied by krileon on topic CB price field with decimal
You could use custom regex validation to enforce a format like that. Alternative is to output the field using a delimiter and use IF substitutions to determine if decimals should be added or not.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum