Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [type-conversion]

Type conversion is the way of implicitly or explicitly changing an entity of one data type into another. This is done to take advantage of certain features of type hierarchies or type representations.

0 votes
1 answer
69 views

Lossy conversion between long double and double

I was cought by suprise that the following code returns false for gcc 13 and clang 18. Why does this happen? Isn't the number 8.1 representable in both formats? #include <iostream> #include <...
Martin Fehrs's user avatar
0 votes
1 answer
20 views

How can I use a parameter to alter which data my profile.Data is accessing?

local expType = tostring(type1) local expTypeStat = expType:gsub("Exp", "") local profileDataExpType = "profile.Data."..expType Here I want to change ...
Lukas Raby's user avatar
0 votes
1 answer
42 views

Conversion failed when converting the nvarchar value to data type int while inserting records into table

I am using a script to automatically update a database daily to sync Azure Blob Storage with a queryable Azure SQL Server database. Among deleting and updating records, I will insert brand new records ...
Tristan Goers's user avatar
0 votes
1 answer
37 views

In Java, Is possible to print doubles like this: "¹" instead of "^1"?

I have two variables, two double vectors. I want to print with Unicode like this: "1¹.¹¹¹¹" (the exponent would be the double), but I don't know how do it exactly. package Math; import java....
Bujakiewicz Franco's user avatar
0 votes
3 answers
80 views

Decimal -> HexaDecimal -> Character Encoding in XSLT

(1) My requirement is to convert a DECIMAL INPUT to hexadecimal notation with fixed 8 digits (2) Convert/Map HEXADECIMAL RESULT to character set by picking 2 HEXADECIMAL characters at a time and ...
Ram Adabala's user avatar
0 votes
1 answer
69 views

How to convert Long datatype to Hex format in XSLT and Perform Long Parsing in XSLT. XSLT to be used in DataPower

Below is my .Net VB code. How do we implement below code in XSLT (XSLT to be used in DataPower). Since we do not have Long datatype in XSLT, we're having tough time to implement below .Net code in ...
Ram Adabala's user avatar
1 vote
1 answer
28 views

.NET c#: Convert string (ej. "Mar 26, 2021 at 7:17 PM") to DateTime object

I am trying to create a DateTime object from strings like Dec 1, 2020 at 11:03 AM Mar 26, 2021 at 7:17 PM Oct 21, 2020 at 3:07 PM I am using this but it throws error: string format = "MMM d, ...
patsy2k's user avatar
  • 551
-4 votes
2 answers
53 views

$false.length -eq 1. Why does it equal 5 when it's the value of an argument of a script?

We have: $false.length 1 And: $var = $false $var.length 1 But: param ([string]$var = $false) $var.length 5 Why is that the case?
Ooker's user avatar
  • 2,637
-2 votes
2 answers
94 views

Custom integer-like datatype with support for static casts without warnings

I'm writing my own little utility library, and I've opted to do something which I don't really see often (and there might be a reason) - I'm trying to implement a 'perfect' wrapper around C++ integer ...
Goubermouche's user avatar
0 votes
1 answer
84 views

Type conversion in user defined class in c++

I made a matrix class in c++ namespace LinAlg { template <typename T> class Matrix { public: Matrix(); Matrix(const uint64_t &rows, const uint64_t &cols); template <typename P&...
Vedant Yadav's user avatar
0 votes
1 answer
35 views

How to convert strings of different units to floats of the same?

I have a panda's dataframe with strings, but I want floats. The units on the strings are different though. One column might be in mm with a few in cm. The next column might be g with a few in kg, and ...
Joseph Summerhays's user avatar
-1 votes
3 answers
110 views

C segfault question: if one of two inputs is null, return the other

I have a function that takes two strings and returns another string (if you must know, its my implementation of strjoin). Now, I want to make it so that if one of the input strings is NULL, it will ...
Cab the Kid's user avatar
-1 votes
0 answers
23 views

Figma converted to React from Function12 not working; my problem or Function12's?

Disclaimer; I'm a beginner, can be considered completely clueless on whatever I'm doing. I exported my Figma design into Function12, trying to convert it into React (but for now, it's purely CSS) and ...
ccsru's user avatar
  • 1
0 votes
2 answers
40 views

Extract(year from column) yields year with one decimal in SQL, why?

I used this to extract year from datetime: select extract(year from orders.OrderDate) It gave me year with one decimal. e.g. 2019.0 Why is this? Any feedback would be appreciated! I also tried: YEAR(...
lu yan's user avatar
  • 1
0 votes
3 answers
95 views

Convert a complex string representation of a list (containing tuples, which look like function calls) into a list

I am trying to create a fixture for unit testing. I retrieve data from an API and need data that looks like what I get from the API without making the call to the API. I need to create a number of ...
Ted M.'s user avatar
  • 380

15 30 50 per page
1
2 3 4 5
917