Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL converting decimal to base 32
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


robin dhiman
converting decimal to base 32
1 Answer(s)      2 years and 3 months ago
Posted in : SQL


procedure for converting decimal to base 32


Advertisement
View Answers

August 27, 2012 at 6:04 PM


CREATE PROCEDURE RTCONVERSION ( @valueToConvert int, @convertedValue varchar(20) out ) AS declare @counter int; declare @num int; declare @x int; declare @flag int;

BEGIN select @counter = 2; select @num = @valueToConvert;

select @flag = 0;

WHILE(@num != 0)
--LOOP
begin
    select @x = @num%36;
    IF( @x > 9) 
    begin
            IF(@flag != 1) 
            begin
                select @convertedValue = char(@x + 55);
                select @flag = 1; 
            end
            ELSE 
            begin   
                --select 1;
                select @convertedValue = char(@x + 55) + @convertedValue;   

            END 
            select @counter = @counter - 1; 
    end
    ELSE    
    begin   
            IF(@flag != 1) 
            begin
                --select 2;
                select @convertedValue = char(@x + 48);
                select @flag = 1; 
            end
            ELSE
            begin
                --select 3;
                select @convertedValue =  char(@x + 48) + @convertedValue;
            END 
            select @counter = @counter - 1;
    END         
    select @num = @num / 36;
--END LOOP;
END
IF(@counter != -1) 
begin
    WHILE(@counter != -1)
    --LOOP
    begin
        IF(@flag != 1)
        begin
            select @convertedValue = char(48);
            select @flag = 1; 
        end
        ELSE
        begin
            --select 4;
            select @convertedValue = char(48) + @convertedValue ;
        END 
        select @counter = @counter - 1;
    --END LOOP; 
    END
 END

END



Related Tutorials/Questions & Answers:
converting decimal to base 32
converting decimal to base 32  procedure for converting decimal to base 32   CREATE PROCEDURE RTCONVERSION ( @valueToConvert int, @convertedValue varchar(20) out ) AS declare @counter int; declare @num int; declare @x
decimal to base 36
decimal to base 36  procedure for converting decimal to base 36   CREATE PROCEDURE RTCONVERSION ( @valueToConvert int, @convertedValue varchar(20) out ) AS declare @counter int; declare @num int; declare @x int
Advertisements
I converting binary to decimal and vice versa
I converting binary to decimal and vice versa  can i ask for the codes in converting binary to decimal and decimal to binary to be run in one program with repeat.. pls. help me! i badly need the codes by monday!! pls
converting From Hexadecimal to Decimal System - Java Interview Questions
converting From Hexadecimal to Decimal System  Write a program in Java user is required to enter a number system XVI and turn it into the decimal... { public static void main(String args[]) { int decimal=0; Scanner input=new
java program 32
java program 32  Write a java program to create server and clint such that server receives data from clint using BufferedReader and send reply to client using PrintStream
SQL Decimal
to a maximum of 32 significant digits and Decimal fixed point can store upto 16... SQL Decimal       SQL Decimal is used to specify the values in decimal datatype. The Decimal datatype
decimal to hexadecimal
decimal to hexadecimal  using array in java convert decimal to hexadecimal.   Hi, Please see the example Convert Decimal to Hexadecimal. Thanks
convert to decimal
convert to decimal  f42a4 convert to decimal by using java
Convert Decimal to Octal
:\codejava>java DecimalToOctal Enter the decimal number: 26 octal:=32... Convert Decimal to Octal       In this section, you will learn to convert decimal number into octal
temperature converting
Fahrenheit temperatures from 32 to 212 degrees in 10 degree intervals Both columns in each chart should be printed to one decimal place Print the charts... * temp) + 32; } public static double celsius(int temp) { return
Decimal Format Issue Java
Decimal Format Issue Java  Decimal Format Issue Java
swing program for decimal to binary
swing program for decimal to binary  swing program for decimal to binary
Convert Hexadecimal to Decimal
Convert Hexadecimal to Decimal     ... into decimal. The java.lang package provides the functionality to convert a hexadecimal number into decimal. Code Description: This program takes a hexadecimal
Convert Decimal to Hexadecimal
Convert Decimal to Hexadecimal       In this section, you will learn to convert a decimal data into hexadecimal. The java.lang package provides the functionality to convert a decimal
data base
data base  how to connect coding in data base ?   The given code connects JSP page to database. You need to import the mysql connection jar file to jdk as well as to the lib of tomcat. Moreover you need to set classpath
Round the Decimal values
Round the Decimal values  How to round the decimal value with out using Math.round() Example:round the 2.7 as a 3.0 round the 2.4 as a 2.0
Convert Decimal to Integer
in converting a decimal type data into an integer. The parseInt() method gets... Convert Decimal to Integer       In this section, you will learn to convert  a decimal number
Converting ISO8601-compliant String to java.util.Date
Converting ISO8601-compliant String to java.util.Date  Converting ISO8601-compliant String to java.util.Date
BINARY TO DECIMAL - Java Beginners
TO DECIMAL  Hi friend, Program to convert Binary To Decimal : import... = sc.next (); int bttm = 1; int decimal = 0; for (int i = str.length() -1; i >= 0; i--) { decimal = decimal + (bttm*Integer.parseInt
conversion from decimal to hexadecimal and vice versa
conversion from decimal to hexadecimal and vice versa  can i get the code for converting decimal to hexadecimal   Here is a code that converts decimal to hexadecimal. import java.io.*; public class
Convert Octal to Decimal
the octal number: 32 Decimal:=26 C:\corejava>_  ... Convert Octal to Decimal     ... to decimal. The following program helps you converts number octal to decimal
Conversion of Decimal to Binary in Java
Conversion of Decimal to Binary  in Java In this section we will discuss about conversion of Decimal to Binary in Java. You know that number having base 10 is a decimal number, for example 10 is a decimal number which can
Convert Decimal into Binary
Convert Decimal into Binary        In this section, you will learn to convert decimal number...; a decimal number into a binary number.  Description of program: This program
DecimalFormat
DecimalFormat       java.text.DecimalFormat is the class that is used for converting the decimal... automatically rounds off  to the number of decimal places.    Handling
converting string to double in java
converting string to double in java  Please post an example to converting string to double in java. Thanks!   Convert String to Double Tutorial
prablems on oracle ee installation in windows7 ultimate(32 bit).
prablems on oracle ee installation in windows7 ultimate(32 bit).  Hai i have face several prablems when ever i m install oracle ee in my system(32 bit)windows7 ultimate.it is not installed in my system.can any body help me how
JAVA AWT BASE PROJECT
JAVA AWT BASE PROJECT  suggest meaningful java AWT-base project
Convert Binary to Decimal
Convert Binary to Decimal      ... number  into a decimal number. The java.lang package provides the facility to convert the integer data into the binary to decimal.  Code Description
java program to convert decimal in words
java program to convert decimal in words  write a java program to convert a decimal no. in words.Ex: give input as 12 output must be twelve
about the base class of file
about the base class of file  what is the basic class of file
base calculator.. - Java Beginners
base calculator..  Help, i need some help about a base calculator.. i don't know how to start
Advertisements
 

 

 

DMCA.com