Questions tagged [data-conversion]

This tag refers to the process of converting the data type of one piece of information into another type.

1963 questions
0
votes
2 answers

In CDS View select statement, how to convert type DEC to type INT?

In a CDS View select statement, given that I have a column of type DEC, how do I convert that to type INT? Work done so far: According to the CAST_EXPR documentation, this is not possible with CAST_EXPR . According to the numeric functions…
Jonathan Benn
  • 2,908
  • 4
  • 24
  • 28
0
votes
3 answers

NSDictionary with float value return wrong conversion

I have NSDictionary with floating values, I am trying to get values like this [[NSDictionary valueForKey:@"some_value"] floatValue]; but looks like value not rounded correctly. For example: I have value in dictionary: @"0.35" but after above…
ArisRS
  • 1,362
  • 2
  • 19
  • 41
0
votes
2 answers

Char vs unsigned char in conversion to int

I stumbled upon this problem while saving an int in a char array and converting it back. I used bit shifts and logic or, but my result ended up with all the bytes after the least significant as 0xFF. My question is: considering this example #include…
Maldus
  • 10,548
  • 4
  • 24
  • 36
0
votes
2 answers

Coverting a JavaScript Object in to Json with a double quote(") as a value

I'm having a problem in converting an object var obj={"Id":"1-AQC1Y1S","Root Order Item Id":"1-AQC1RSA","SC Long Description":"6.5" TXL/Qn/"}; In the above object, we have a value like 6.5" in a string. Please help me out here. Thanks in advance.
0
votes
2 answers

Convert "0000" into a lubridate in R

What appears simple, is for me quite a brain teaser. I got this times1 <- c(0000, 0720, 2315, 0600, 1150, NA, 0000) and I want got transform this number in hours and mintues with the hm-function that I get an lubridate format. Thank you very much…
0
votes
1 answer

static_cast use to convert int to char

I have written this code to convert Decimal to binary: string Solution::findDigitsInBinary(int A) { if(A == 0 ) return "0" ; else { string bin = ""; while(A > 0) { int rem = (A % 2); bin.push_back(static_cast(A % 2)); A = A/2…
0
votes
2 answers

BaseConversion using Strings and bases 2 - 36

I have a program that prompts the user for a string, an initial base, and a final base. The program works fine for all digits however, when I enter in a string mixed with digits and characters it does not return the correct answer. For example, when…
Austin Johnson
  • 697
  • 11
  • 23
0
votes
1 answer

Convert XML to Json in angular4.0?

My XML 0 0 0
Gaurav_0093
  • 1,040
  • 6
  • 28
  • 56
0
votes
1 answer

no known conversion from 'const int [5][4]' to 'const int **' in a constructor

I have a class with this constructor: Dfa(const int n_state, const int dim_alf, const string *alf, const int s_state, const int** tt_copy ); I try to create a dfa object like this: const string alph[3] = {"a","b","c"}; const int ttable[5][4] = {1,…
user4351223
0
votes
2 answers

How to convert DateTimeOffeset to DateTime in SQL Server

How to convert DateTimeOffset to DateTime? I have tried using: CONVERT(VARCHAR, 2018-03-02 12:00:00.0000000 -07:00, 120) but the result is: "2018-03-02 12:00:00 -07:00" Ex: "2018-03-02 12:00:00.0000000 -07:00" to "2018-03-02 12:00:00"
K.Tom
  • 175
  • 1
  • 6
  • 16
0
votes
0 answers

Cannot import framework after converting project from ObjC to Swift - 'No such module'

I'm a newbie coder, re-using an app design originally coded in ObjC. The app is camera-based and compiles and runs fine in XCode 9.2 running an image recognition service against a 3rd party's cloud servers. I converted the app using Swiftify from…
Art2VR
  • 3
  • 6
0
votes
0 answers

Function in python from JavaScript

I need help for writing this JavaScript function in Python. Write a javascript function that accepts a string as a parameter and converts the first letter of each word of the string in upper case. e.g 'the quick brown fox' EXPECTED OUTPUT: 'The…
0
votes
1 answer

How does Base64 convert to ASCII characters?

I'm reading this article on "How Base64 Encoding Works", and I see that Base64 converts each set of 3 8-bit bytes into binary, then convert that binary into 4 groups of 6 bits. Finally, those 4 groups are reassembled back into integers and…
Richie Thomas
  • 3,073
  • 4
  • 32
  • 55
0
votes
1 answer

Python/Simulink/MATLAB: How to properly read single-type 4bytes data from Simulink in Python?

I have a program in Simulink to send some values through TCP-IP and to read them in Python 2.7. The data is sent as "single" values. The code in Python reads that as 4 strings as its 32 bits long (string of length 4). print "x0:", ord(data[0]) print…
0
votes
0 answers

How do you convert binary value strings into ASCII values in Python 3?

I am trying to convert binary value strings into ASCII values on Python 3. Let's say the letter 'l' in ASCII has a binary value of 01101100. If the '01101100' is represented as a string, how would you convert that string into the ASCII value in Base…
Symb1ote
  • 1
  • 1