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
-
2
votes3
answers1174
viewsConversion of variables type int to char*. C++
I have the following method that takes two int variables as parameter and I need to concatenate these two values into a char variable*, only for this to be possible it is necessary that these two…
-
2
votes1
answer894
viewsTryparse error of Datetime converting string in Double format
I have a method of using the DateTime.TryParse to convert a string for the guy DateTime, but lately I’ve realized that string format Double would also be being converted to date. Is there any…
-
2
votes1
answer3401
viewsConvert hexadecimal string to C-readable output
I would like to save a text in hexadecimal, and calling a function, the hexadecimal string is converted to a readable char string, i.e., decoding the hexadecimal, for example 0x6f0x69 for oi. I…
-
2
votes1
answer2822
viewsHow do I turn a BLOB-type file into an image using PHP?
I need to transform a BLOB file that comes from a MYSQL database to the Image type, to use on my site, I need to do the conversion using PHP, when I use the image in BLOB format, it goes to the…
-
2
votes1
answer91
viewsConvert path (String) to object
I need a function that converts: "/home/username/Documentos/app.txt" for an object: { "home": { "username":{ "Documentos": "app.txt":{} } } } ` I was thinking of breaking the string by the "/", but…
-
2
votes3
answers511
viewsWhat is the most recommended "Try" or "if"
{ public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { double SalarioBase = 0, Descontos = 0, Vantagens = 0; try { SalarioBase =…
-
2
votes3
answers2679
viewsConvert number to date
Good afternoon, I wonder if there is a way to convert number to date in PHP. Example, in Excel the number 42873 is equivalent to date 18-05-2017. And I have how to do the opposite too. Is there a…
-
2
votes2
answers849
viewsHow to pass a float without loss of value to an integer?
I have a float variable that can contain any number in it, I need to test if it fits an integer without losing values. I thought to use some test to see if the numbers after the comma are 0’s or…
-
2
votes3
answers2812
viewsHow to convert a string to boolean?
In Javascript, when running Boolean('false') The value returned is true and the expected was false, since strings with any non-empty content when converted to boolean return true and the empty…
-
2
votes1
answer14068
viewsConversion from VARCHAR to INT
I’m trying to do INNER JOIN but the fields are in VARCHAR. In a field I have cod_authorization = 749831164 And in the other field I have num_aut = 000749831164 Because of the zeroes "Left"…
-
2
votes1
answer101
viewsConvert query to Sqlserver
I have the following query for the Oracle bank: select xmlagg(xmlelement(e, d.delinha, '').extract('//text()') order by d.nulinha).getclobval(). I need to convert to run in the Sqlserver bank, but…
-
2
votes3
answers120
viewsConvert String to Date and remove 1 day from String
I got this string: $data_final = "26/11/2017"; And I need this variable to look like 25/11/2017. That is, I need to convert string to date and remove 1 day from that date.…
-
2
votes0
answers46
viewsError reading HTM file for HTML conversion to JSON file
In this Topic I created Been asked how to download zip file from Box server and unzip it on my hosting service which occurs perfectly. After the previous events described, I want to read the html,…
-
2
votes1
answer134
viewsDifference in Java casting
What is the difference between the 2 codes below? first int x = 10; float i = (float) x; 2nd int x = 10; float i = Float.parseFloat(x);…
-
2
votes4
answers788
viewsConvert Int to String
I’m trying to make a button to register to the bank but am having difficulties in converting the int to String. follows my line of code: private void…
-
2
votes2
answers436
viewsConvert float value to String
I’m programming for android, and I’m trying to display a float value found by function getX() in a Toast, which only displays String values. How do I do this conversion?
-
2
votes3
answers551
viewsConvert string to integer positions
Console.Write("Digite um numero de 4 digitos: "); string numero = Convert.ToString(Console.ReadLine()); int soma = 0; for(int i = 0; i < numero.Length; i++) { soma += Convert.ToInt32(numero[i]);…
-
2
votes3
answers3749
viewsProblems with input results after using an "int()"
Code example: idade = input("Qual a sua idade? ") int(idade) if idade >= 45: print("Tá velho cara, já era!") else: print("A vida está só começando rapaz!") Error found: Qual a sua idade? 45…
-
2
votes1
answer394
viewsChange the type of a column in several tables in SQL Server
I have a database with 41 tables, in all tables I have a common column to which I would like to assign another dataType. In my case the column is currently varchar(255) and would like to change to…
-
2
votes1
answer122
viewsComma to Numeric number conversion in R
I have a script that receives a user value, via readLines. This value is a number (monetary value) with two decimal places that must be saved in a frame date. However, when I convert the received…
-
2
votes1
answer84
viewsHow to resignify bytes without Undefined behavior?
Details In Assembly, C, C++, C# with unsafe and other languages it is possible to reinterpret binary code at the address as of different type from the original. Convert type int* for float* in C,…
-
2
votes1
answer95
viewsWhen a calculation is made in C#, is the primitive type of the variable maintained in the result?
I’m creating a simple C# application to calculate some flight information, in which you have a class called Calculator containing the following methods: public static float GetDistance(ushort…
-
2
votes1
answer64
viewsMy subtraction calculus in Javascript is returning a "Nan"
I am a beginner in Javascript and I was doing a change calculation program. I used the following code: <h1>Calculando o Troco</h1> <input type="button" value="Comprar produto"…
-
1
votes2
answers2812
viewsDecimal variable removing decimal places
I have a variable in decimal which receives a value of a textbox, but when this variable receives the value with decimal places it removes the decimal place and stores the value without the same.…
-
1
votes2
answers2031
viewsProblems with types and conversions when filling a page
That is the mistake: An exception of type 'System.InvalidCastException' occurred in App_Web_fjskumyk.dll but was not handled in user code Additional information: Não é possível converter um objeto…
-
1
votes1
answer933
viewsHow to convert a string to a number in Lua?
In Lua, how to convert a string type value to the number type (integer, float etc.)?
-
1
votes1
answer76
viewsType conversion going wrong
I have a data conversion problem when going through For Each, accuses the item "vl_maodeobra" cannot be converted from String to type Integer. The problem is that no matter what conversion I try to…
-
1
votes1
answer114
viewsDoubts with conversion of variables
I’m making a child game that tests your mathematical knowledge. Basically the game is as follows: The entry page has a series of interconnected houses, where each house has its own numerical value.…
-
1
votes1
answer63
viewsDisplay a formatted Timespan time
I have two variables: TimeSpan horaI = new TimeSpan(10, 00, 00); TimeSpan horaF = new TimeSpan(22, 00, 00); I need to present them on the screen as follows 10:00 and 22:00. But I’m not getting it.…
-
1
votes0
answers60
viewsString to Date conversion using an html form
I’m having trouble converting String to Date, here are the codes: Event: @Entity(name = "Evento") @Table(name = "evento_table") public class Evento { @Id @GeneratedValue(strategy =…
-
1
votes1
answer6279
viewsConvert String to Double while maintaining content
I need Java to convert a String which has a binary value (Ex: "0111010") for a double. I tested: String teste = "101010101"; double number = Double.parseDouble(teste); System.out.println("The number…
-
1
votes1
answer290
viewsCreating dynamic tabs and combos - Jsf / Primefaces
I am working on a project that has as a basic requirement that the user can create screens to display data coming from various data sources. The user creates what we call Dashboard and includes…
-
1
votes2
answers73
viewsHow do you get the time zeroes out?
I am using a Label to receive the time of a video. The time I receive from the video is a double which comes in milliseconds, for example: 1555 = 1,555 sec. When I convert to TimeSpanthe label…
c# winforms visual-studio-2015 type-conversion conversionasked 8 years ago Caio Henrique Nespolo 45 -
1
votes1
answer41
viewsNot converting INTEGER to String
Good Afternoon, my application has the function of monitoring virtually a football game, and it contains a button that saves the name of the team and the number of goals that the team made... Only…
-
1
votes2
answers54
viewsConversion of SQL Server types
I got the following SELECT in SQL Server: SELECT th.CidadeCod, th.ContratoCod, CONVERT(DECIMAL(5,2), ( SUM(th.PlacasLidas)/SUM(th.Trafego) ) * 100) AS [IndiceOCR] FROM controle.TrafegoFaixaHora th…
-
1
votes1
answer281
viewsCAST for monetary value stored in text in Mysql
In the table of products of the bank there is a field valor that has the type varchar(255) Observe the query : Consultation SELECT valor as valor_original, CAST(valor AS DECIMAL(18,2)) as…
-
1
votes3
answers527
viewsDo I need to use "Convert.Toint32()" for text?
I think it’s something with the Convert.ToInt32(), because I didn’t understand its function inside the language. Observation 1: The place where I learn is American and I don’t know much English.…
-
1
votes1
answer53
viewsHow do I validate how many images are inside a TIFF file?
I want to do a validation in C# for when to convert a TIFF image to JPEG I can know if all the images have been converted, because TIFF is a single file that sometimes brings several images inside…
-
1
votes1
answer65
viewsChanging customer information via ID
I cannot change customer information through ID Code that makes the changes in the Database public void Atualizar(Contato contato)//metodo para atualizar dados: update { OleDbParameter[] parametros…
c# database asp.net ms-access type-conversionasked 7 years, 7 months ago André Felipe Jardim Firmo 127 -
1
votes1
answer957
viewsHow exactly do you divide two variables?
In the code below I try to divide the values, but I end up getting a completely wrong answer from the calculation: nota1 = input ("Digite a nota 1: ") nota12 = input ("Digite a nota 1: ") nota2 =…
-
1
votes0
answers391
viewsREST API for CSV to JSON conversion
Good morning guys, I’m facing a problem currently, I need an API that can converge CSV to JSON via REST. I have located several CSV to JSON converters on the web, but they are built for use in the…
-
1
votes1
answer774
viewsHow to put an integer number on a label
I’m trying to put a kind of score counter on a Jlabel ex: you hit a question the score goes to 1 , you miss and nothing happens to the score. I tried to do it that way : private void…
-
1
votes2
answers2397
viewsHow to transform str into int?
I tried to turn the score into int as I did in Javascript but it didn’t work: placar = "0 x 0" print(int(placar)) I expected it to show 0 but it resulted in a mistake, as I do to turn the score into…
-
1
votes3
answers3370
viewsHow to convert Date to whole in Java?
When I use this code: Date data = new Date(); SimpleDateFormat formatador = new SimpleDateFormat("dd/MM/yyyy"); int dataAtual = Integer.parseInt(formatador.format(data));…
-
1
votes1
answer345
viewsConverting E MMM dd HH:mm:ss Z yyyy to dd/MM/yyyy HH:mm:ss c#
I’m getting the following date Thu Sep 01 00:00:00 BRT 2016 and need to convert to dd/MM/yyyy HH:mm:ss Only that the Convert generates error, I’m receiving this date via string of a System. Can…
-
1
votes3
answers178
viewsHow to store a single character?
My class has an attribute that is a single character. I can store as string, but I think the right thing would be char. Only this attribute can receive one int (between 0 and 9) another method. How…
-
1
votes1
answer434
viewsHow to convert an object to Boolean in Ruby?
Ruby objects have some methods for representation in another type, such as: to_s: convert to string to_a: convert to array to_i: convert to whole to_f: convert to float But there is no standard…
-
1
votes1
answer966
viewsConvert input to date with oracle
I’m having trouble returning the results of the following query, where I put the variable &mes, if I put '01-Sep-2017' would bring the results I need, but in the dialog box wanted the user to…
-
1
votes3
answers100
viewsConvert decimal to ushort
I need to convert a value decimal for ushort in my application: Is there such a possibility? If yes, how to convert? I tried to use the Convert.ToInt16(value), but it didn’t work. Console example:…
-
1
votes1
answer67
viewsChange FFMPEG generated GIF size
I am generating gifs using ffmpeg, in its latest version (to date of this issue), using the following lines of code: ffmpeg -y 10 -i in.mp4 -vf fps=10,scale=-1:340:flags=lanczos,palettegen…