This tag refers to the process of converting the data type of one piece of information into another type.
Questions tagged [data-conversion]
1963 questions
22
votes
5 answers
Interfaces, Inheritance, Implicit operators and type conversions, why is it this way?
I'm working with a class library called DDay ICal.
It is a C# wrapper for the iCalendar System implemented in Outlook Calendars, and many many many more systems.
My question is derived from some work I was doing with this system.
There are 3 objects…

Alec Scratch
- 277
- 2
- 10
21
votes
2 answers
How to improve Dart performance of data conversion to/from binary?
Doing some consulting work for a bigger German companies Future Technologies Group I have ported about 6000 lines of Java server side software to Dart. This should help to answer the question whether Dart can efficiently be used on the server.…

Tina Hildebrandt
- 1,277
- 1
- 11
- 20
20
votes
5 answers
Matching records based on Person Name
Are there any tools or methods that can be used for matching by a person's name between two different data sources?
The systems have no other common information and the names have been entered differently in many cases.
Examples of non-exact…

Even Mien
- 44,393
- 43
- 115
- 119
19
votes
3 answers
Number to String in a formula field
I am using a formula field to concatonate 2 decimal values separated by a dash. However, I want the result to trim all unneccesary trailing zeros and decimal points for both values.
For example, I want values 10 and 8.5 to be "10 - 8.5". Now it…

Mike Cole
- 14,474
- 28
- 114
- 194
19
votes
4 answers
String.Format vs ToString and using InvariantCulture
I am a little confused here.
What should I use
Console.WriteLine((val/1085).ToString("N"));
VS
Console.WriteLine(String.Format("{0:N}", (val/1085)));
Also how do I fit the InvariantCulture? ANY BEST PRACTICES :)?

Joe
- 515
- 2
- 5
- 6
18
votes
3 answers
Best way to convert an Eigen Vector4 type to Vector3?
I want to extract the three first values of a Vector4 type in Eigen, into a Vector3 type. So far I am doing it in a for-loop. Is there a smarter way to do it?

Reed Richards
- 4,178
- 8
- 41
- 55
18
votes
4 answers
Auto Mapper convert from string to Int
I am creating a simple MVC4 application
I have a automapper
Mapper.CreateMap()
.ForMember(dest => dest.IntphoneNo,
opt => opt.MapFrom(src => src.Stringphoneno));
IntphoneNo is of DataType…

user2739679
- 827
- 4
- 14
- 24
18
votes
4 answers
Get date representation in seconds?
I am using an API which requires a date parameter as a number of seconds, an int.
My problem is that I currently store this time in java.util.date and I was wondering if there is some way to convert the java.util.date variable to seconds so that I…

Sam
- 861
- 3
- 10
- 16
17
votes
3 answers
Why does Ruby's String#to_i sometimes return 0 when the string contains a number?
I was just trying out Ruby and I came across String#to_i. Suppose I have this code:
var1 = '6 sldasdhkjas'
var2 = 'aljdfldjlfjldsfjl 6'
Why does puts var1.to_i output 6 when puts var2.to_i gives 0?

hsinxh
- 1,865
- 6
- 21
- 25
17
votes
1 answer
SQLAlchemy: Convert column value back and forth between internal and database format
In my database, I have some columns where data is stored in some weird format. Since the database is used by other code, too, I cannot change the data format.
For example, one of the weird formats is that a time value is represented as a string like…

Marian
- 5,817
- 2
- 18
- 21
17
votes
2 answers
Converting MM:SS.ms to seconds using MS excel
I am looking for a neat way of converting a cell from
Minutes:Seconds.Milliseconds to
Seconds.Milliseconds
i.e.
11.111 = 11.111
1:11.111 = 71.111
I have something in place at the moment but its a bit hacky and I am sure there must be some nice…

Jambobond
- 619
- 3
- 12
- 23
16
votes
1 answer
Passing a integer through command line in C?
I was wondering if someone could explain how passing arguments through command line works? I'm really confused by how it works. Right now I'm trying to pass one integer into the main program. How would I go about doing this?
EDIT: keep getting the…

JVAN
- 193
- 1
- 2
- 11
16
votes
4 answers
How to Convert pythons Decimal() type into an INT and exponent
I would like to use the Decimal() data type in python and convert it to an integer and exponent so I can send that data to a microcontroller/plc with full precision and decimal control. https://docs.python.org/2/library/decimal.html
I have got it to…

ericnutsch
- 275
- 1
- 2
- 10
16
votes
4 answers
How to convert letters with accents, umlauts, etc to their ASCII counterparts in Perl?
I'm writing a program that works with documents in Perl and a lot of the documents have characters such as ä, ö, ü, é, etc (both capital and lowercase). I'd like to replace them with ASCII counterparts a, o, u, e, etc. How would I do it in Perl?
One…

bodacydo
- 75,521
- 93
- 229
- 319
15
votes
3 answers
How to get the original python data from QVariant
I am just learning python and Qt these days. So please consider that this will be a newbie question, but I am stuck here.
import sys
from PyQt4.QtCore import *
data1 = 'string'
data2 = QVariant(data1)
data3 = data2.toPyObject()
I expected data3 is…

Jonas Hong
- 275
- 1
- 2
- 7