Results 1 to 9 of 9

Thread: How to convert character data to integer data

  1. #1
    Join Date
    Jul 2010
    Posts
    65

    How to convert character data to integer data

    I trying to convert a int worth 1254 a Byte. It will not be possible since only the type ByteWe can encode that values ranging -127 and 128. So , if we make the conversion, we will lose information. I need to loss conversions without loss of information and those that involve loss of information . There is no loss of information when the magnitude of the converted number is stored. So i want to know how to convert character data to integer data. any idea. Please help.

  2. #2
    Join Date
    Nov 2005
    Posts
    1,323

    Re: How to convert character data to integer data

    There are 19 conversions without loss of information which are included in the table below . These conversions do not lose information in terms of quantity , but the conversion to a primitive type can lead to a decimal loss of accuracy. For example, when converting a int or long to a double or floatThe least significant digits may be lost while the magnitude of the number is the same. So , to summarize , the conversions without loss of information does not lose information about the size of number. The conversion of an integer to an integer not lose any information , or precision , and conversion is perfect. Finally, conversions int to float and long to float and double may cause a loss of accuracy .

  3. #3
    Join Date
    Oct 2005
    Posts
    2,393

    Re: How to convert character data to integer data

    It is possible in C to define a new type of data with the keyword typedef. It admits the following syntax:
    typedef Caracteristiques_du_type Nom_du_type

    where
    * Caracteristiques_du_type represents a type of data exists ( eg float, short int, ...)
    * Nom_du_type defines the name you give to the new data type

    Thus the following statement creates a data type Ch modeled on the type chariot

    Code:
    typedef char Ch

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: How to convert character data to integer data

    When the data is converted to a string data type (chariot, varchar, nchar, nvarchar, binary, varbinary, text, ntext or image) in a data type binary or varbinary different lengths , SQL Server truncates the string or full right. When other data types are converted binary or varbinaryThe data are supplemented or left-truncated . They are padded with hexadecimal zeros .

  5. #5
    Join Date
    Feb 2008
    Posts
    1,852

    Re: How to convert character data to integer data

    Data conversion data types binary and varbinary can be useful if the data binary are the means of moving data more convenient. The conversion of the value of any type, binary value large enough , then reconvert it into its original type always produce the same value if the two conversions are performed in the same version of SQL Server. The binary representation of a value can vary from one version to another SQL Server .

  6. #6
    Join Date
    May 2009
    Posts
    539

    Re: How to convert character data to integer data

    As the variant type variables can contain numbers and strings, it is difficult to predict whether the variable A assigned the number 2. To avoid errors due to implicit type conversions , it is necessary to apply themselves to a certain discipline in programming , such as avoiding the use of data type variant. To avoid other errors resulting from implicit type conversions , OpenOffice.org Basic provides a range of conversion functions , you can use to set when the data type of an operation must be converted:
    CStr ( Var )
    converts any data type to string.
    CInt ( Var )
    converts any data type into an integer value.

  7. #7
    Join Date
    Feb 2010
    Posts
    669

    Re: How to convert character data to integer data

    Converts a subset of an array of unsigned 8 bits in a subset equivalent of an array of Unicode characters encoded using base 64 digits .Parameters specify the subsets as offsets in the tables of input and output and the number of elements in the input array to convert.

  8. #8
    Join Date
    Jun 2009
    Posts
    784

    Re: How to convert character data to integer data

    The subset of elements length of InArray starting at position offsetIn is a numerical value and is converted to a subset of elements in outArray, Starting at position offsetOut.The return value indicates the number of elements converted outArray.The subset outArray consists of digits in base 64. In base 64 and from scratch , the characters are , in ascending order : the uppercase " A " to "Z " characters "a" through "z , " the numbers " 0 " "9" , and symbols " + " and " / " .The valueless character , "= "is used for filling the right.

  9. #9
    Join Date
    May 2009
    Posts
    201

    Re: How to convert character data to integer data

    CAST() and CONVERT() are available as of MySQL 4.0.2. The CHAR conversion type is available as of 4.0.6. The USING form of CONVERT() is available as of 4.1.0. CAST() and CONVERT(... USING ...) are standard SQL syntax. The non-USING form of CONVERT() is ODBC syntax. CONVERT() with USING is used to convert data between different character sets. In MySQL, transcoding names are the same as the corresponding character set names. For example, this statement converts the string 'abc' in the server's default character set to the corresponding string in the utf8 character set.

Similar Threads

  1. Replies: 4
    Last Post: 04-01-2014, 10:47 AM
  2. How to Convert Reliance 1x data card to EVDO data card ?
    By Balgovind in forum India BroadBand
    Replies: 5
    Last Post: 21-10-2010, 09:18 PM
  3. Replies: 4
    Last Post: 25-09-2009, 05:09 PM
  4. Convert tabular data to a matrix in Excel
    By Rookieinexcel in forum Windows Software
    Replies: 2
    Last Post: 23-04-2009, 10:19 PM
  5. How to Convert FAT to NTFS Without Losing Data
    By Jigar in forum Tips & Tweaks
    Replies: 2
    Last Post: 04-10-2008, 03:27 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,262,771.15278 seconds with 17 queries