This topic is locked

European data format

3/11/2006 12:25:17 PM
PHPRunner General questions
A
albeza author

Hello,
I must develop my project in european data format, and with new version of PHPRunner a have a good view of my data currency, but when I go into edit form I have the US format. For example if I insert my numer in this european format 1.500,34 when i save my data the field return me 1,5, and this is very wrong...

How is possible resolve this problem ?
thanks

Sergey Kornilov admin 3/13/2006

Albeza,
you can do it to change include/..._fuctions.php file. Find make_db_value function and add snippet of code. See my changes in Bold:

global $fieldlist,$strTableName,$filename,$files_delete,$files_move,$thumbnail_fields,$thumbnail_prefixes,$thumbnail_maxsize;

$filename="";

$finfo = & $_SESSION[$strTableName."_fieldinfo"][$field];

if(Format($field)==FORMAT_NUMBER)

{

$value=str_replace(".","",$value);

$value=str_replace(",",".",$value);

return 0+$value;

}


if(!$type)



Then find BuildEditControl function and add following snippet of code:

if(IsDateFieldType($type))

return '<input type="hidden" name="type'.$ifield.'" value="date'.EDIT_DATE_SIMPLE.'">'.GetDateEdit($field,$value,0,$ifield,$edit);

if(Format($field)==FORMAT_NUMBER)

{

$value=format_number($value);

}


return '<input type="text" name="value'.$ifield.'" '.GetEditParams($field).' value="'.htmlspecialchars($value).'">';