• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Need input default number without any thousand separator

Hi,

I can't remove "thousand separator" from my element that is a number.
I need input default value into this element and see it displayed without any thousand separator.
When my default value is displayed with thousand separator like:
26,812
or
26 812

when "save" data on form i get in my element: "26" not "26812" what i need.
That is no possibility to display numbers in that way:
26812.

Element data with number is saved on form using script:

PHP:
$db =& JFactory::getDBO();
$quantity2 = (int) '{ccjom_cc_kk_karta_rejestr___zamow_quantity_pos_ordered}';
$currentserial2 = (int) '{ccjom_cc_kk_karta_rejestr___product_serial_num2}';
$idclone2 = (int) '{ccjom_cc_kk_karta_rejestr___id}';

    $idclone4 = $idclone2 - $quantity2;
    $currentserial4 = $currentserial2 - 2;
    $i = 1;

for ($i = 1; $i <= $quantity2; $i++) {
  
    $idclone5 = $idclone4 + 1;
    $idclone4 = $idclone5;
 
    $currentserial5 = $currentserial4 + 2;
    $currentserial4 = $currentserial5;
  
$query1 = "UPDATE `ccjom_cc_kk_karta_rejestr` SET `product_serial_num2`= " .$currentserial5. " WHERE `id` = " .$idclone5. " " ;

$db->setQuery($query1);
$db->query();

   }

I save on form value from variable: $currentserial5. I save this value to some number of records that i clone them.
Variable $currentserial5 get its value from displayed number ( unfortunatelly displayed with thousand separator) in field:
{ccjom_cc_kk_karta_rejestr___product_serial_num2}

Can you help to solve this?
 

Attachments

  • Zaznaczenie_040.png
    Zaznaczenie_040.png
    47.2 KB · Views: 375
  • Zaznaczenie_041.png
    Zaznaczenie_041.png
    5.6 KB · Views: 397
Last edited:
I discovered this way in my php code:
PHP:
$db =& JFactory::getDBO();
$quantity2 = (int) '{ccjom_cc_kk_karta_rejestr___zamow_quantity_pos_ordered}';
$currentseriala = '{ccjom_cc_kk_karta_rejestr___product_serial_num2}';

$currentserial2 = filter_var($currentseriala, FILTER_SANITIZE_NUMBER_INT);
$idclone2 = (int) '{ccjom_cc_kk_karta_rejestr___id}';

    $idclone4 = $idclone2 - $quantity2;
    $currentserial4 = $currentserial2 - 2;
    $i = 1;

for ($i = 1; $i <= $quantity2; $i++) {
   
    $idclone5 = $idclone4 + 1;
    $idclone4 = $idclone5;
  
    $currentserial5 = $currentserial4 + 2;
    $currentserial4 = $currentserial5;
   
$query1 = "UPDATE `ccjom_cc_kk_karta_rejestr` SET `product_serial_num2`= " .$currentserial5. " WHERE `id` = " .$idclone5. " " ;
$db->setQuery($query1);
$db->query();

   }

This works.

But there is any way to display numbers without any thousand separator, i need also display in my lists numbers without "thousand separator" ?
 
I don't understand why you are enabeling "Number format" if you don't want to use it.
But anyway:
If you are doing (int)$string php takes the characters from left to the first non-numeric one, so '26 812' will become 26.
You should use {element_raw}
 
I need number format, but users that should work with my fabrik list and forms want see:
26812
not
26 812 or 26,812
element contains number but should be displayed like this: 26812
 
So just set field "Format" to integer but "number format"=no ("number format" is exactly for doing 26 812 or 26'821 or whatever you set for thousand seperator, see tooltip)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top