Int (x [, base]) converts x to an integer long (x [, base]) and converts x to a long integer float (x) convert x to a floating point complex (real [, imag]) to create a plural str (x). Convert x to a string repr (x) convert object x to expression
int (x [, Base])#convert x to an integerLong (x [, Base])#convert x to a long integerFloat (x)#convert x to a floating-point numberComplex (real [, Imag])#Create a complex numberSTR (x)#convert an object x to a stringREPR (x)#convert an object x to
Python standard library: built-in functions hex (x) and pythonhex
This function is used to convert a hexadecimal string representation of an integer object, such as the 0x format. If the object is not an integer, define a method ___ index _ () to
Qt int, float, double to qstring
There are two ways of
1. Use
Qstring::number ();
Such as:
[CPP] View plaincopyprint?
1. Long A = 63;
2. QString s = Qstring::number (A, 10); s = = "63"
3. QString T = Qstring::number (A,). ToUpper (); t =
In the development process of Python, it is unavoidable to encounter type conversion, here is a common type conversion demo:
type
Description
int (x [, Base])
Convert x to an integer
Long
1. The problem arisesA small problem has recently been encountered, namely:
Read the contents of the text file, then convert the number appearing in the file (including double, int, float, etc.) to 16 binary 0x storage
Originally
Python programming and development-type conversion convert instance analysis, python programming and development
This article describes how to convert the type of python programming to convert. We will share this with you for your reference. The
In MFC programs, you can use the Format method to easily convert numeric types such as int, float, and double to CString strings. The following is a format description supported by the CString format:%c single character
%d decimal integer (int)
%ld
This article mainly introduces the usage of type conversion convert in python programming and development, and analyzes the common data types in Python and the specific usage of type conversion convert in the form of examples, for more information,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.