Double :: convertTo: Bitrix method

      
<?php 
//  Bitrix\Bizproc\BaseType\Double :: convertTo()
//  /dist/bitrix/modules/bizproc/lib/basetype/double.php:48

    
public static function convertTo(FieldType $fieldType$value$toTypeClass)
    {
        
/** @var Base $toTypeClass */
        
$type $toTypeClass::getType();
        switch (
$type)
        {
            case 
FieldType::BOOL:
                
$value = (bool)$value 'Y' 'N';
                break;
            case 
FieldType::DATE:
                
$value date(Main\Type\Date::convertFormatToPhp(\FORMAT_DATE), (int)$value);
                break;
            case 
FieldType::DATETIME:
                
$value date(Main\Type\DateTime::convertFormatToPhp(\FORMAT_DATETIME), (int)$value);
                break;
            case 
FieldType::DOUBLE:
                
$value = (float)$value;
                break;
            case 
FieldType::INT:
                
$value = (int)$value;
                break;
            case 
FieldType::STRING:
            case 
FieldType::TEXT:
                
$value = (string) $value;
                break;
            case 
FieldType::USER:
                
$value 'user_'.(int)$value;
                break;
            default:
                
$value null;
        }

        return 
$value;
    }