Converting involves changing data from one data type or format to another.

learn more… | top users | synonyms

1
vote
2answers
59 views

Converting from Celsius to Fahrenheit, vice versa

My code does the following: Asks the user for the type of conversion, the degrees and spits the result back. It will prompt the user to ask for the type of conversion again if it's invalid. It will ...
1
vote
1answer
50 views

Grabs 10 bytes and converts it into a hex formatted string

I'm working on some code right now where the goal is to take in a byte stream and grab the data from the body of a message. The data is 10 bytes long and is meant to be translated into hex. ...
3
votes
2answers
38 views

Python script converts after effects clipboard keyframe data to nuke keyframe data

This is my first 'proper' script since learning python and I'd love it if I could get some feedback on things I've done wrong / things I can improve on. The script takes clipboard data from after ...
0
votes
1answer
108 views

Hex-to-octal converter

The code converts hexadecimal into octal. The function is working, but it takes more than a second to process the input. How can I optimized this? ...
3
votes
2answers
74 views

Convert decimal to binary and vice-versa in Java

I'm trying to learn Java, so I'm doing a few exercises from a programmer project idea book. This exercise requires that the program be able to convert a decimal number to binary and vice versa, like ...
1
vote
2answers
100 views

Character-to-string converter

I created a program that will convert a 3-character combo into a 3-string combo. I used a lot of if statements to accomplish the conversion. I'm wondering if there ...
10
votes
4answers
982 views

Arabic to Greek numeral converter, 1 - 10

One of the things that's straight-forward in JavaScript is Unicode support. If you want to return ϝ (lowercase digamma, not a simple ...
7
votes
5answers
1k views

Comparing Old vs. New: Temperature Converter

I made this temperature converter when I first started getting into Python. After a year of regular programming on my own I decide it was time to revisit my old program. Now that I finished my first ...
5
votes
1answer
43 views

Creating PDF files from a ODT template

The code is actually a TemplateBuilder. We have 2 different templates, French and Dutch. We need to change the template and then convert it to PDF so it can be stored in the DB later. The main method ...
-5
votes
1answer
71 views

Python to Ruby: inconsistency with float ceil() [closed]

Just for fun, I am trying to convert the following Python from math import * print map(lambda count: ceil( 6 * cos((count + i) * pi / 5) ), range(100)) Which ...
4
votes
2answers
112 views

Converting hex to integer

What's the fastest way of doing this? ...
5
votes
1answer
97 views

Function to convert a decimal number as a string to hexadecimal

I am designing a cipher and need to convert between bases repeatedly in a loop. I have optimized the everything else, but I'm not too familiar with C++ code, and and am trying to figure out how to ...
2
votes
1answer
30 views

Handler for bidirectional unit conversion form

Building a form where values can be entered in either pounds or kilos. Script is... ...
11
votes
6answers
778 views

Converting strings to PascalCase

I have a method which I use on occasion to convert strings (like enum and property names) to PascalCase for display. It's ...
16
votes
3answers
826 views

SI unit converter

I recently started "coding" and this is one of my first "projects". It is supposed to be an SI converter where you can type a value, its unit and the unit to which you want it to be converted. ...
2
votes
2answers
106 views

Parsing from one enum to another

I face a problem I think I am not approaching appropiately. I have two independent enumerators that both will contain the same members, the only difference being the values given. I have to be able ...
4
votes
2answers
183 views

Java conversion of base 16 to base 64

I wrote a solution in Java to solve the problem here. I use BigInteger to convert first from base 16 to base 10, then base 10 to base 64. This seems quite ...
4
votes
3answers
326 views

12 hours to 24 hours conversion function

I have made a time format converter which converts 12 hour format to 24 hour format. My convert_to_24() takes a string in format of ...
7
votes
1answer
85 views

Three-way conversion between Japanese writing systems

When my go-to Japanese transcription site went down for a while, I decided to write my own. My application converts between Romaji, Hiragana and Katakana — however, unlike any other converter ...
0
votes
2answers
179 views

Currency converter in Python [closed]

I am looking for some ways to make my code simpler for this currency converter. ...
3
votes
2answers
205 views

Converting a 12 hour time string to a 24 hour time string

Input - Standard input - HH:MM:SS[AM|PM] format. Examples: 12:00:00AM 12:00:00PM 01:00:10AM 01:00:10PM The program reads one line per instance. Output - military format (24 hour format): ...
10
votes
3answers
355 views

Binary Converting Code

I made a program that converts a decimal number given from the user, and converts it to a binary number. For example, if I entered 2, it would return 10. It then, counts the amount of ones and zeros ...
3
votes
2answers
47 views

Convert hex encoded string to byte array

The following should read a hex string such as "ece998a2fb" into vector 236 233 152 162 251. I was unable to find any built in ...
5
votes
1answer
222 views

Converting IP Addresses to minimal binary formats

Once more, I come to you for assistance! I have written a significant bit of code that converts IP Addresses from strings to minimal byte-arrays. (So that you can store them in a binary format instead ...
1
vote
1answer
103 views

Convert string to integer or default

I need my string-to-int converter to handle all exceptions without throwing any errors. I also have a use case where I need the default value to be less than zero if the ...
1
vote
1answer
55 views

Celsius and Fahrenheit Converter

I'm very new to programming in C and I attempted to make a program that converts temperatures to and from Fahrenheit and Celsius. I have been running the program and I have realized that not all ...
1
vote
1answer
58 views

Filter to convert duration to hours — in controller or model?

I have this before_action method : ...
3
votes
2answers
210 views

Java Temperature Converter GUI

Today is my first time working with GUI, so I'm really interested in the best ways of handling various events to get the best habits from the jump. Most of the GUI-related code for this project was ...
4
votes
2answers
1k views

Hexadecimal number to decimal conversion

I am a semi-beginner in C++ and I have a project in C++ to convert a hexadecimal integer into decimal equivalent, but I extended it and now this program can also convert a fractional part. Logic I ...
4
votes
2answers
92 views

Basic distance conversion program

This is a simple program to convert miles, yards, feet, and inches appropriately. Everything intended for works but I feel my program is very redundant. How can I make it more efficient and less lines ...
5
votes
1answer
129 views

Hex to Double converter

I stumbled on this SO question which was asking about a way to convert larger hex values to a positive numeric value: ...
12
votes
1answer
703 views

Roman Numerals in Java

I wrote a class that can convert to and fro from Roman Numerals and Decimals. I would appreciate critical points on everything, especially: Shortening my code. Choosing a better approach. Using ...
1
vote
2answers
45 views

Decimal to Roman numeral conversion algorithm

I have written a program to convert a decimal to a Roman numeral. I am wondering if my algorithm is okay or not. If it's not okay, I want suggestions on improving my code. This code only works in ...
7
votes
5answers
776 views

Creating a numeric phone keypad

I'm writing a Telephone class and it has a method called getDigits which takes in a String parameter and returns the number that would appear on your phone if you ...
7
votes
1answer
188 views

Replacement string Base64 (and a Base32) conversion [closed]

This provides (my own) implementation of ToBase64String and FromBase64String (since the .NET implementations suck), and a ...
6
votes
4answers
322 views

Character to decimal conversion

This converts from character representation of integers to their decimal value: ...
6
votes
5answers
371 views

Using functions to separate code for Fahrenheit to celsius conversion

I'm relatively new to programming, and I've been wondering about a problem such as this. How can I think about decomposing the code into its constituent functions? I went the simplest route I could, ...
6
votes
2answers
124 views

Number converter between bases

I just wrote a utility program in C that converts numbers of different bases to 'standard' well-known bases (hex, dec, oct, bin). I called it repnum, short for ...
8
votes
3answers
160 views

HTML to Markdown converter

I've made a simple HTML→Markdown converter in Javascript and am looking for any feedback. For now, I've basically used Stack Exchange's /editing-help as a guide as ...
4
votes
1answer
144 views

GUID to hex-string and back

I'm new to Python and I'm trying to convert between Microsoft GUIDs and plain hex strings: ...
3
votes
3answers
642 views

Unit Converter in Python

I am new to programming and I am trying to make a simple unit converter in python. I want to convert units within the metric system and metric to imperial and vice-versa. I have started with this code ...
3
votes
1answer
47 views

Map strings to (const) ints

I'm imagining go generate would be a good tool for this. I want to convert strings to ints to save space. ...
1
vote
1answer
491 views

Powershell to Convert HTML Table to Array of PSCustomObject

I created the below script to sent a request to a website, then convert the table in the results to an array of PSObjects which I can work with in PowerShell. This uses some nasty hacks (e.g. using a ...
2
votes
1answer
250 views

Currency converter using MVC pattern in C++ & QT

While understanding the MVC pattern, I came across this particular article. I thought to implement it using the C++/QT library. The intent over here is to implement/use MVC concepts in correct way. ...
6
votes
4answers
3k views

Conversion of hexadecimal string to string

Given a C# string which is a set of hexadecimal numbers such as: string HexString = "202048656c6c6f20576f726c64313233212020"; Where those hexadecimal numbers ...
3
votes
2answers
377 views

Converting numbers to English words

This is a simple program to convert a number, from 0 up to 99999999, to English words. Example: If the input is: 1234 The output would be: one thousand ...
10
votes
2answers
908 views

Convert Persian digits to English numbers

I use the following code to convert ۱۲۳۴۵ to ‍12345, effectively transliterating the persian numbers into latin numbers: ...
3
votes
2answers
126 views

Integer to English Conversion

I wrote some code to translate numbers ( for now just positive, up to the 32bit limit ) into English words. Everything works and I'm happy. I searched through the site looking for a comparison code ...
6
votes
4answers
225 views

Converting from decimal to word

I'm still investigating the problem with decimal to word conversion. I understood the basics, but now my goal is to learn how to add in base-26 (the English alphabet) or base-52 (...
0
votes
3answers
67 views

Low-latency implementation of converting non null terminated char* to unsigned int

How would you rewrite this code which I have now: ...