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

learn more… | top users | synonyms

3
votes
4answers
487 views

Hex to Decimal converter

Any feedback is welcome: ...
1
vote
1answer
31 views

Storing Data In a Image pixels

I wrote a tool to store text as colors in a image around the border. I then saved the resulting image to file. To use the resulting file I set it's path to a the src attribute of a tag and call ...
2
votes
1answer
28 views

All-in-one number base converter

I coded this program as a challenge for /r/dailyprogrammer. Basically this program can convert any number from any base to another base including negative bases as long as the input is coherent. Did I ...
3
votes
3answers
96 views

Converting click count data to JSON

I have an array filled with 5 other arrays that consists of arrays of 2 values (first a date then a count): ...
1
vote
3answers
77 views

Converting text to colored pixels and back again

Any suggestions for improvement or critiques are welcome! ...
2
votes
1answer
42 views

Convert a formatted file size to bytes

I needed to convert a formatted file size back into its length in bytes. I came up with the following code but want it reviewed: ...
6
votes
3answers
114 views

Using enum descriptions to string/text binding

In my WP8 application I need to show a couple of radio buttons to let the user select a value out of an enum. I don't want to hardcode either the value or the text ...
4
votes
1answer
53 views

Converting to Roman Numeral with Recursive Algorithm

Summary I'm getting ready to dive back into a "more proper" project, so I wanted to take a moment to get my TDD hat on before doing so. I decided to tackle this Roman Numeral Kata for practice. The ...
4
votes
1answer
99 views

Convert number into hours : minutes

I wrote a simple extension to convert a number into a hours and minutes string in the ##:## format. This seems like a good way to do it, but let me know what you think. ...
3
votes
1answer
49 views

Conversion Helper with support for enumerations and Nullable<T> - The Remix

I recently wrote this code as a more versatile stand-in for Convert.ChangeType. I very recently posted an earlier version, for which I received some good feedback. I've incorporated that feedback and ...
1
vote
0answers
47 views

HTML to plain text converter

Please, review the code below. Test class: ...
5
votes
3answers
89 views

Conversion helper with support for enumerations and Nullable<T>

I recently wrote this code as a more versatile stand-in for Convert.ChangeType. I have a nagging feeling that there's something I might be overlooking, or that ...
6
votes
2answers
255 views

Low-level methods with temperature conversion program

This is my first program to convert temperatures. I have a very basic knowledge of Python and I tried using only what I already knew to make the program. What are some improvements I can make, or how ...
11
votes
2answers
382 views

Application for converting markdown to PDF

First time writing C in a long time and would like some code review to try and improve my code. I have some specific questions, but first an introduction to the code. The application is a simple ...
4
votes
2answers
165 views

Convert plain text to HTML C#

I have the ToHtml() Extension Method ...
1
vote
1answer
57 views

Converting a wrapper object to a value object

I have ChannelWrapper and Channel Value Object. I want to convert each and every field of ChannelWrapper to Channel Value ...
5
votes
2answers
103 views

toBase64 encoder

My code convert text to Base64. I used the algorithm without bit operations. What do you think about my code? ...
4
votes
2answers
61 views

Translation of Number Systems

My code converts a number from one number system to another (from binary to 36 and back). Do you think my formatting is successful or not? ...
4
votes
1answer
66 views

Motor degree movement function

I want to control a motor which rotates a device over a gear. Input values for the device are from 0 to 360 degrees. The motor should always rotate the device the shorter way around. For example, if ...
3
votes
2answers
162 views

Binary to decimal number converter

Here I am doing some exercises for my studies with Python. This is a binary to decimal number converter (currently restricted to that). These are the very first steps, so there is no error handling. ...
6
votes
2answers
145 views

Converting fractions to mixed numbers

I've been making a program for an assignment that converts fractions to mixed numbers, and I'm done, but I was wondering if I could simplify it in any way, since it seems quite complicated right now. ...
4
votes
2answers
42 views

Convert impute2 files to mach format

Here is a program for converting Impute2 files into MaCH format (related to genetics). Source files include one xxx_haps file and one xxx_samples file, for example: ...
5
votes
2answers
271 views

Convert Roman to Int

I made a function that converts Roman letters to integers. But I'm not happy with it, as I feel like I used too much code for a such a simple task. Any suggestion on how I can minimize it? ...
0
votes
3answers
247 views

Cast an object to Decimal? or Int? etc but leave it as null if it is null

In a case like this: object A1 = null; Decimal? B = Convert.ToDecimal(A1); object A2 = null; int? C = Convert.ToInt32(A2); Note that in case where ...
10
votes
3answers
566 views

Beginnings of a base-conversion game in Python

I'm pretty very new to python, so I thought that I'd write a game to teach me python and better teach me how to think in hexadecimal and binary. I'm starting off by writing a few functions to convert ...
3
votes
1answer
101 views

Convert between two bases, each between 2 and 36

I'm doing some Python practice for fun and I wrote some code that converts between two bases. I'm thinking about expanding on this later, so the docstrings are pretty redundant from function to ...
5
votes
1answer
49 views

Converting decimal integers to a string representation in an arbitrary base between 2 and 26

This code takes an integer and returns a string representing the value in a different base. The value for the base can range between 2 and 26. I have had someone already look over this code and they ...
11
votes
2answers
1k views

Introductory Currency Converter

This is my basic currency converter for my intro to Java class. I'm supposed to be able to convert between Yen, Dollars, Pounds and Euros using static rates. It works, but I was curious to know if I ...
4
votes
4answers
192 views

Conversions calculator

I'm a student currently studying computing/programming at school and am a beginner and would like some help understanding how to shorten down my code. I know some basic Python and can program ...
0
votes
1answer
55 views

Converting integers to strings

I drafted a method that I intend to use to convert integers to strings. Is there a way to make it faster? Are there any "simple" changes I could make to improve its performance? This cannot be done ...
3
votes
1answer
89 views

Dirty XML-to-JSON parser

I have that XML-to-JSON function based on ElementTree. It looks very simple but until now it does what it's supposed to do: give a JSON description of the ...
4
votes
2answers
622 views

Convert number into words

I am trying to implement a program which can convert number into words. My code can convert numbers between 0 - 999. It uses recursive function calls and simple arithmetic operations. Can you please ...
11
votes
2answers
121 views

Conversion Between Units

I have created a java program that should take a list of conversions and be able to convert one unit to another. My main goals are maintainability and readability, but speed would be nice as well. ...
2
votes
2answers
188 views

“Nice Angles” - Code Eval challenge

Out of fun, I solved "Nice Angles" challenge on CodeEval in C# 4.0: CHALLENGE DESCRIPTION: Write a program that outputs the value of angle, reducing its fractional part to minutes and ...
3
votes
3answers
57 views

Hexadecimal to string without C++ standard library functions

For the purposes of this code review, I will use the standard library, but pretend that <cstddef> is <stddef.h>, ...
2
votes
1answer
149 views

Encoding and decoding exercise

I was issued the following coding challenge from a company to write an encoding and decoding function: Encoding: This function needs to accept a signed integer in the 14-bit range [-8192..+8191] ...
2
votes
1answer
56 views

A function to convert FASTA .txt to a dictionary

I'd like feedback on my function to convert FASTA data to a dictionary in Python. Here's an example of FASTA text: ...
4
votes
3answers
844 views

Turning numbers into text

Here is my program that turns numbers into text. It can be extended to millions, billions, trillions and so on. Please review my code and here is what I expect from the users: Is there any better ...
10
votes
2answers
261 views

Numbers to words converter

Please review my code: ...
5
votes
2answers
261 views

Converting a boolean list to string, and vice versa

I am currently using this to convert a List of booleans to a string ...
7
votes
1answer
175 views

Hexadecimal to RGB conversion

I am trying to convert hex to rgb, and rgb to hex. My current code doesn't seem optimal, and there is an issue with 0's in the hexadecimal. What do you think about the overall quality of this code? ...
4
votes
2answers
156 views

Converting a string to various number formats

I'm working on a set of PostgreSQL helper classes, and am representing each PostgreSQL data type as objects. Instead of creating a class for each number format, I've created a template so the user can ...
3
votes
2answers
93 views

Numbers to Strings in Python part 2

After implementing most of the suggestions from the first question, This is the code I got: ...
10
votes
4answers
582 views

Integer seconds to formated string mm:ss

I have a String like "Time left (XX)" or "You need stay here for (XX)" and int as second. I use those two variables to format ...
8
votes
1answer
269 views

Very simple PostgreSQL ORM in C++ using libpq

I'm working on a set of helper classes for working with libpq in C++ and I want to be able to pass in objects to the helper classes and have them internally represented as strings when sent to the db, ...
6
votes
2answers
130 views

Convert numbers into a textual form

So this was originally inspired by @nhgrif's Int extension for translating integer to plain English, however the code is mainly a port of @rolfl's Converting a number to the text representation; ...
4
votes
2answers
125 views

Numbers to English Strings in Python3

Inspired by the recent surge of questions dealing with changing numbers to their English equivalents (See here, here, and here), I decided to write my own version in Python. ...
8
votes
1answer
169 views

Spell a given number in English

I wrote a program that will take a number from 0 to 999,999,999,999 and spell out that number in English. How could I improve the readability of my code? ...
12
votes
3answers
998 views

SQLConnect - A library for connecting Objective-C/Swift applications to Microsoft SQL Server

The complete SQLConnect library can be found here. The file from which the following method belongs can be found here. At some point I may or may not open questions for reviewing other aspects of ...
6
votes
2answers
297 views

Positive integer to Roman Numeral conversion function

For the past two hours I was searching for a built-in function for converting an integer to an equivalent Roman numeral, but it failed to achieve the target. Hence I wrote my own routine for ...