
Is there anyway to Convert Decimal To Binary In Cosmos? Thanks  Matt



If BitArrays work (which I'll have to find out) you can do this which would give you a string of ones and zeroes. It isn't really decimal, but an integer should do the job
using System;
using System.Collections;
namespace Cosmos
{
public static class Number
{
public string ToBinary(int number)
{
BitArray array = new BitArray(BitConverter.GetBytes(number));
string s = "";
for (int i = 0; i < array.Length; i++)
{
if (array[i])
s += '1';
else
s += '0';
}
return s;
}
}
}

