type-conversion Questions

4

Solved

I have a field for call length in my raw data which is listed as an object, such as: 00:10:30 meaning 10 minutes and 30 seconds. How can I convert this to a number like 10.50? I keep getting errors...
Bobbie asked 5/2, 2015 at 20:15

4

Solved

Okay so I'm an a fairly annoying situation where I don't have access to typed arrays such as Float32Array, but still need to be able to convert a Javascript number into bytes. Now, an integer I can...
Nocturn asked 10/4, 2013 at 20:3

6

I have a nvarchar column in one of my tables. Now I need to convert that column values to INT type.. I have tried using cast(A.my_NvarcharColumn as INT) and convert (int, N'A.my_NvarcharCo...
Medallist asked 19/10, 2012 at 5:22

3

Solved

I am using both the native Datetime and the Noda Time library LocalDate in the project. The LocalDate is mainly used for calculation whereas Datetime is used in rest of the places. Can someone pl...
Heiser asked 9/8, 2016 at 6:9

7

Solved

During a recent job interview process, I submitted some sample Perl code which used the so-called "secret" !! operator. Later, when discussing the code, one of the interviewers asked me why I chose...
Eserine asked 8/10, 2015 at 11:9

3

Solved

One can convert a string to an integer in numerous ways, e.g. parseInt("-1",10) Math.floor("-1") Number("-1") "-1"|0 ~~"-1" I assume the first is the canonical form, but e.g. asmjs uses the thi...
Nammu asked 3/6, 2013 at 17:56

4

Solved

I just noticed that an interface cannot be assigned to Record<string, unknown> (playground link): interface Foo { foo: number } const foo: Foo = { foo: 1 } const bar: Record<string, unkn...
Transformation asked 19/1, 2021 at 20:48

14

Solved

I have a select query that has DURATION column to calculate number of Minutes . I want to convert those minutes to hh:mm format. Duration has values like 60, 120,150 For example: 60 becomes 01:0...

3

Solved

I am writing an ASP.NET 5 MVC 6 (Core) application. Now I came to a point where I need to store (set and get) an object in the session-cache (ISession). As you may know, the Set-method of ISession...
Hypozeuxis asked 14/3, 2016 at 16:49

4

Solved

My task is to read data from excel to dataframe. The data is a bit messy and to clean that up I've done: df_1 = pd.read_excel(offers[0]) df_1 = df_1.rename(columns={'Наименование [Дата Файла: 29.0...
Corporate asked 31/5, 2019 at 8:10

3

Solved

I wanted to convert an object of type bytes to binary representation in python 3.x. For example, I want to convert the bytes object b'\x11' to the binary representation 00010001 in binary (or 17 i...
Pacifistic asked 10/7, 2017 at 11:19

7

Solved

Like: float(1.2345678901235E+19) => string(20) "12345678901234567890" Can it be done? (it's for json_decode...)
Knotgrass asked 29/7, 2011 at 17:16

3

Solved

For my telegram bot (python-telegram-bot) i generated a PIL.Image.Image and i want to send it directly to a user. What works is to send an image as bufferedReader from a file, but i don't want to ...

6

Solved

Using the new Enum feature (via backport enum34) with python 2.7.6. Given the following definition, how can I convert an int to the corresponding Enum value? from enum import Enum class Fruit(En...
Izawa asked 30/5, 2014 at 9:50

3

I'm new in C# and need to read float values (x, y, z) from file. It looks like: 0 -0.01 -0.002 0.000833333333333 -0.01 -0.002 If Iam trying float number = float.Parse("0,54"); // it wor...
Miranda asked 31/12, 2014 at 13:48

21

I have looked through previous questions, but none had the answer I was looking for. How do I convert milliseconds from a StopWatch method to Minutes and Seconds? I have: watch.start(); to start ...
Letta asked 12/7, 2013 at 21:31

25

Solved

I want to convert an object like this: {"1":5,"2":7,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0} into an array of key-value pairs like this: [[1,5],[2,7],[3,0],[4,0]...]. H...
Lycopodium asked 8/8, 2016 at 8:21

4

Solved

I have a dataframe with a DataTime column (with Timezone in different formats). It appears like timezone is UTC but I want to convert the column to pd.to_datetime and that is failing. That is probl...
Assiduity asked 27/3, 2019 at 19:57

4

I have a C# property which is of data type bool and when it gets set, it becomes a True or False. However I need for it to match up with a SQL Server table column of type bit so that it is saved a...
Fowlkes asked 17/9, 2015 at 6:58

36

Solved

I want to convert these types of values, '3', '2.34', '0.234343', etc. to a number. In JavaScript we can use Number(), but is there any similar method available in PHP? Input Output '2' 2 '2.34' 2...
Lickerish asked 16/12, 2011 at 4:8

7

Solved

Yeah, I know. Long title of question... So I have class name in string. I'm dynamically creating object of that class in this way: String className = "com.package.MyClass"; Class c = Class.forNa...
Boraginaceous asked 12/12, 2009 at 13:2

8

I keep getting this error message everytime I run this query: Msg 8115, Level 16, State 8, Line 33 Arithmetic overflow error converting numeric to data type numeric. The statement has been terminat...
Godroon asked 12/1, 2011 at 16:0

7

Solved

I often use code like in example below and was wondering if there is some smart way to type the find results without having to do explicit type assertion. type Foo = { type: "Foo" }; type Goo = { ...
Antependium asked 26/11, 2019 at 11:35

19

Solved

How do you convert a data frame column to a numeric type?
Shem asked 18/2, 2010 at 12:17

5

Solved

How should I perform conversion from IPv6 to long and vice versa? So far I have: public static long IPToLong(String addr) { String[] addrArray = addr.split("\\."); long num = 0; for (int i = ...
Directive asked 26/7, 2013 at 7:45

© 2022 - 2024 — McMap. All rights reserved.