Most voted "type-conversion" questions
Type Conversion is the method used to adapt one type of data to another so that it is possible to relate to a target type.
Learn more…239 questions
Sort by count of
-
4
votes2
answers396
viewsConvert string value to hexadecimal without changing format
I am using the following code in a Class. public Int16 Endereco = 0x7302; byte[] Data = BitConverter.GetBytes(Endereco); Array.Reverse(Data); [...] I would like to receive the value for the variable…
-
4
votes2
answers1349
viewsHow to convert a nullable int to common int
I have a method that gets an integer that can be null, if it happens some executions of methods, but when I will use the same variable in a place that uses int which cannot be null, it appears that…
-
4
votes1
answer97
viewsHow is the conversion from String to Float done in Javascript Core?
I’ve always been curious to know how the conversion really works string for float internally in the javascript, so I would like to receive a full and detailed answer explaining what javascript does…
-
4
votes2
answers192
viewsWhy is there no String.Toint() method?
String in C# is an object, right? From what I saw to string is a class, different from int and other primitive types that are simple types, (I’ve seen on another site too, that they are all objects…
-
4
votes1
answer1240
viewsConvert Unix Timestamp to Datetime
I am trying to select the largest date from my table, however the dates are stored in Unix Timestamp format in a whole column type. I need to do this conversion because I need to calculate the…
-
4
votes3
answers329
viewsWhy does my "Try" in Python not work?
x = int(input("Por favor, insira um número: ")) try: print(x != int) except ValueError: print("Somente números.") The mistake that gives is: ValueError: invalid literal for int() with base 10: 'x' I…
-
4
votes2
answers318
views"-" operator cannot be applied to a string
I’m trying to make some changes to a ready code, but I came across a problem with a line of code written in C#: string[] textArray1 = new string[] { -899253461.ToString() }; In this case, Visual…
-
4
votes1
answer166
viewsMath.Running defining minimum and maximum values other than 0
I’m trying to set the minimum and maximum value, using Math.random() * (max - min) + min;, for example, informing on the Html page the minimum = 10 and the maximum = 20, but the results are always…
-
3
votes1
answer278
viewsI get NA when I convert Character to time (Posixlt)
Why do I get NA when I do this conversion from Character to Posixlt? library(bReeze) data(winddata) tempo <- winddata[,1] tempo[1:6] # Preview # [1] "06.05.2009 11:20" "06.05.2009 11:30"…
-
3
votes1
answer1362
viewsHow to convert from Timestamp to Calendar?
I need to convert a resultSet of the returning bank in Timestamp in a Calendar type variable.
-
3
votes1
answer147
viewsHow to convert a String of this type to a Date Object
I’m working with an Ontology at Protegé 4.1 and I have a Dataproperty that is a Datetime. I’m taking this Datetime this way: ["2015-06-30T16:38:53"^^xsd:dateTime] How do I put the date like this on…
-
3
votes1
answer634
viewsHow to convert latitude/longitude to Double in C#
I have a problem because I have a variable of the type string and I need to convert to the guy double without losing the "dot". Example: string latitude = "-8.709006" when converting is equal to:…
-
3
votes1
answer1342
viewsHow to convert date to datetime?
I have the following case, I’m trying to convert the one field date for datetime using the update update tb_RHContratos set DtCadastro = cast(DtCadastro as datetime) But some of the date this does…
-
3
votes2
answers52
viewsI believe my mistake is in the matrices, or type conversions, but how to solve?
I’m new to java and I have to make a tetris. In this class in particular, I create 2 control matrices to manage the positions of the pieces on the screen, but it’s giving error. Does anyone have a…
-
3
votes3
answers847
viewsConversion of a variable with replace to decimal
I’m having a little doubt, I pass a value 0,05 decimal for a variable A of the kind string. After this variable receives this value, it does the conversion of , to point ., which remains 0.05 After…
-
3
votes2
answers1359
viewsSpecified conversion is not valid in Executescalar
The specified conversion error is not valid happens in the code: if (command.ExecuteScalar() == DBNull.Value) { resultados[j2][i2] = 0; } else { resultados[j2][i2] =…
-
3
votes2
answers331
viewsI cannot enter user-defined values in Sqlite
I have a problem where I can not add anything in the table and always appears the error: sqlite3.Interfaceerror: Error Binding Parameter 0 - probably Unsupported type. The code I’m trying to add…
-
3
votes1
answer237
viewsConvert Double to String Mongodb
I own a field Double in a Collection on Mongodb and would like to exchange this field in every collection to String.
-
3
votes1
answer572
viewsConvert String to Calendar
I’m trying to make a conversion of String for Calendar but without success. My String is in dd/MM/yyyy format. I need to convert to yyyy-MM-dd And set on an object of type Calendar. void…
-
3
votes2
answers159
viewsDouble wrapper initialization with int does not compile
I want to understand why this boot doesn’t work: (1): Double d = 10; // Não funciona I understand that Double is a wrapper, the compiler should convert this line to: (2): Double d =…
-
3
votes1
answer2685
viewsC# Convert object to an unknown list of objects
I have a question here. I have an object (Object) received by parameter. It can be a single object or a list of objects (List). Can I convert the object to a List object WITHOUT RECEIVING THE TYPE…
-
3
votes1
answer1027
viewscannot be cast to java.lang.String autocomplete primefaces
I’ve had this problem for days, and I can’t fix it. I am using primefaces autocomplete to search for customers registered on my system. I have already done my converter, I followed a tutorial and…
-
3
votes2
answers1159
viewsConvert string to integer
I can’t convert my text TextBox in one piece. namespace Pag98_Exe1 { public partial class frmveiculos : Form { public frmveiculos() { InitializeComponent(); } Veiculos veiculos = new Veiculos();…
-
3
votes2
answers109
viewsCustom typing
According to the DOC Type handling, the conversions allowed are: (int), (integer) - molde para inteiro (bool), (boolean) - converte para booleano (float), (double), (real) - converte para número de…
-
3
votes2
answers468
viewsWhat is the corresponding timestamp variable type (SQL Server) in C#?
I have a field in the database (Seqalteracao) of type timestamp and need to map it to C# (Entity Framework). What is the corresponding type in C# for this type in the bank? public **Tipo**…
-
3
votes2
answers37
viewsWhy does To_char(3E4) not result in '3E4'?
Guys like me convert an exponential number (NUMBER) to string (VARCHAR) but it is expressed equal?? Example: SQL> SELECT TO_CHAR (NUMERO) NUMCONVERT 2 FROM (SELECT 3E4 NUMERO FROM DUAL);…
-
3
votes1
answer1076
viewsPython type conversion
When writing some didactic examples in Python 2.7, I came across the following situation in the following program: a = 0b101 b = 0b111 c = a+b print c The result of this program is 12 (decimal). If…
-
3
votes1
answer3224
viewsInput string was not in a correct format
When calling the method below comes the message the input character string was not in a correct format private void SubmitData() { try { string user = usuario.Text; string pass = senha.Text;…
-
3
votes2
answers179
viewsWhy can’t I assign a list of a more specific type than the declared type?
I have this class example: public class User : APerson { private string _userName; [DataMember] public virtual string UserName { get { return _userName; } set { if (string.IsNullOrWhiteSpace(value))…
-
3
votes2
answers893
viewsHow to remove part of a JSON file
I need to remove parts of a JSON, but I don’t know how to do it I’m converting the same to CSV, and when I convert the structure gets all weird Follow print explaining better, what is marked in…
-
3
votes3
answers608
viewsRead a console line in C#
CS1503 Argument 1: cannot convert from "group of methods" to "Object" using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace…
-
3
votes2
answers301
viewsChanging data types in a Python list
I have a list x, with 10 numbers, being all of them whole. I’d like to turn them all into numbers like float, but I can’t perform that conversion. Code: lista = [1,2,3,4,5,6,7,8,9,10] for i in acs:…
-
3
votes1
answer79
viewsWhat are Widening and Narrowing conversions?
I’ve heard that term in type conversions on . NET, but I don’t know if that applies to other platforms and/or languages. I have no idea what these terms are, so what is a conversion Narrowing and a…
.net terminology characteristic-language type-conversionasked 4 years, 10 months ago CypherPotato 9,292 -
3
votes1
answer59
viewsConvert a Double with more than 13 decimal places to String without losing values
I have in C# the following number in Double: 124.00767638369544. When I simply put valor.toString(), the value goes to: 124.007676383695, IGNORING the 0,00000000000044. The system I’m making needs…
-
3
votes1
answer40
viewsStringbuilder append() converts to string automatically
Why when I use .AppendLine() it is necessary to convert the parameter to string, but when use .Append() conversion is not necessary?
-
3
votes3
answers40
viewsHow to turn a 2D Array into 2D Pointer in C
It is possible for a function to receive as a parameter a reference to the address of a two-dimensional array (matrix) static, and from the pointer to access the elements of this matrix. In the…
-
2
votes1
answer237
viewsHow to convert a JSON object to XML in AS3?
Is there any method of converting a JSON object to an XML object using the actionscript-3 with Flash CS6?…
-
2
votes1
answer113
viewsConvert text to image using Zend Framework
Doubt: There is another way to convert text into image PNG other than by **ImageMagick**? We are using the Zend Framework. I installed the module [Php5-imagick][1], but it took a lot of work and I…
-
2
votes1
answer849
viewsData conversion in types such as int and double
I’m having trouble making data conversions from a database, for example I perform a query to the bank like this: carteira ca = bc.carteira.FirstOrDefault(obj => obj.cpf == cepf &&…
-
2
votes1
answer1118
viewsConvert . raw file to . mp3 file or other audio format
I have an app that makes audio recordings and stores them on a server. I need these files to be converted from the . raw extension to any audio format, preferably the extension. mp3, to be…
-
2
votes0
answers2604
viewsProblems with JSF converter: "f:convertNumber"
Good night to you all, In an application I developed in JSF the converter worked well running locally with local mysql database (JPA/Hibernate) but when I deployed the application and put it into…
-
2
votes1
answer1608
viewsHow to convert a Decimal value to Datetime?
Can anyone help me with the following question? I have returns of two variables. Examples: 1st - of the type decimal (vdecTotalHoras) and the 2nd - also of the type decimal (vdecMediaAnalise), both…
-
2
votes1
answer453
viewsitt' is not recognised
I am trying to compile the code below with GCC 4.7.4, but always get the bug error: ạ itoa' was not declared in this Scope #include "otpch.h" #include <iomanip> #include <stdlib.h>…
-
2
votes1
answer159
viewsWrong string to double conversion
I have in my app.config the following code: <add key="FolhaA4" value="0.168056514197457, 6.36413684210526"/> And here the method to get these key values: private double[]…
-
2
votes1
answer3478
viewsConvert string to Datetime
How to take from a string something like "30/01/2015", for example, and convert it to datetime and maintaining the same date format? You can validate the date.
-
2
votes2
answers985
viewsHow to convert stdClass to array recursively?
I have the following object: $a = new stdClass; $a->id = 1; $a->nome = 'wallace'; $a->parentes = new stdClass; $a->parentes->pai = 'Sidney'; $a->parentes->mae = 'Maria'; I know…
-
2
votes1
answer260
viewsUnion and type conversion
Searching about Unions I found the following information: Unions are usually used for type conversions. For example, we can use a Union to write the binary representation of an integer in a disk…
-
2
votes2
answers3604
viewsSpecified conversion is not valid
I’m making an appointment with LINQ in the DataTable in that code snippet. I have to check if a link already exists for a registered person in the database. My query using the LINQ is working…
-
2
votes1
answer60
viewsString to Date conversion
I have html form with the following input: <div class="form-group"> <label class="col-md-4 control-label" for="textinput">Início:</label> <div class="col-md-4"> <input…
-
2
votes2
answers286
viewsConvert an Ipaddress to string
This code retrieves the gateway standard, but I can’t convert the result to string and put on a label. public static IPAddress GetDefaultGateway() { var card =…