Questions tagged as 'cast'

1
answer

Error converting object type to int

I'm doing a select in the database, using ExecScalar returning an object but I can not make a cast of this returned value to integer. public static int ConsultaPDVsAtivos() { NpgsqlCommand sql = new NpgsqlCommand(); sql.CommandText = "...
asked by 09.02.2017 / 13:03
1
answer

Java cast and convert

How do I convert ValueCallback<Uri> to ValueCallback<Uri[]> ?     
asked by 16.10.2015 / 18:26
2
answers

How to convert scientific notation to string with full number

What php function should I use to do this type of conversion?    Converter: 1.3388383658903E + 18 for: 1338838365890273563 I tried this, but it did not work: echo sprintf(sprintf('%%.%df', 0), '1.3388383658903E+18'); And that too:...
asked by 04.10.2016 / 19:26
0
answers

CAST in several columns to take the average

I have several columns in a csv table, I imported the table into mysql, but when I import into mysql I have to do this import as varchar for all data. If I make a CAST in these columns and then take the average I believe it will give the value o...
asked by 26.04.2018 / 00:37
0
answers

Cast problem

I have the following classes: public class Hotran { @Getter @Setter private String codEmpresa; @Getter @Setter private String nomeEmpresa; @Getter @Setter private Long voo; @Getter @Setter pr...
asked by 27.12.2017 / 22:48
0
answers

Convert a variable to a reflect.Type

I started learning Go recently. I want to be able to save a data type to a variable, and convert another variable to it. I know one way to save a data type is by using reflect.Type . i := 5 t := reflect.TypeOf(i) var f float32 = 4.2 B...
asked by 29.09.2017 / 02:40
2
answers

Problems converting integer to string (stringstream) c ++

#include <iostream> #include <string.h> #include <sstream> using namespace std; int main(int argc, char *argv[]){ int n, aux; string hexa=""; stringstream hexa_aux; cin >> n; while(n != 0){ a...
asked by 10.08.2017 / 02:13
1
answer

Error converting type String to Integer in NodeJS

In Nodejs I am trying to check the value of a variable of type String, but for some reason nothing is working. Example: var aaa = "0"; // Eu recebo essa variável como string (não dá para mudar o tipo) console.log(typeof(aaa)); // String co...
asked by 22.07.2017 / 05:29
1
answer

Conversion of value from database into monetary value with error

In the database ( SQL ) I have a field named Valor which is a decimal and contains the following value: 21581 that would be $ 215,81 However when doing casting of this value it is returning $"{reader["valor"]:c}" "R$...
asked by 09.12.2016 / 17:19
1
answer

Select with cast (numeric as decimal) works, but view creation does not

Good morning everyone! I currently work with postgresql and I'm doing a database migration, and I need to create a view of my old database tables. Well, I need the number columns to round with 15.3 but I'm finding a problem that I can not fig...
asked by 22.09.2016 / 15:24