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