Question: decimal to base 36

rahul
decimal to base 36
1 Answer(s)      4 years and 8 months ago
Posted in : SQL

procedure for converting decimal to base 36

August 27, 2012 at 6:09 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:
decimal to base 36
decimal to base 36  procedure for converting decimal to base 36  ...; select @flag = 0; WHILE(@num != 0) --LOOP begin select @x = @num%36...; END select @num = @num / 36; --END LOOP; END IF(@counter != -1
converting decimal to base 32
converting decimal to base 32  procedure for converting decimal to base 32   CREATE PROCEDURE RTCONVERSION ( @valueToConvert int... = @num%36; IF( @x > 9) begin IF(@flag != 1
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
SQL Decimal
SQL Decimal       SQL Decimal is used to specify the values in decimal datatype. The Decimal datatype can be of two types : Decimal (p) refers to floating point and Decimal fixed
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
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
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
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
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 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 to Octal
Convert Decimal to Octal       In this section, you will learn to convert decimal number into octal.  The decimal format has 10 digits (that are 0,1,2,3,4,5,6,7,8,9
JAVA AWT BASE PROJECT
JAVA AWT BASE PROJECT  suggest meaningful java AWT-base project
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
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
HTML - base tag example.
HTML - base tag example. Description : The base tag is a HTML tag. It specifies a base(default) URL for all link in the page. Code : <html> <head> <base href="http://roseindia.net"> <
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
HTML5 base tag, Definition of base <base> tag in HTML5.
HTML5 base tag, Definition of base <base> tag in HTML5. In this tutorial, we will introduce you to  <base> tag of HTML5. Base tag allows... document. OR We can define URL in base tag if there is different link has same URL
Data base Connectivity
Data base Connectivity  How to configure JDBC connection for Oracle data base.In configuring it is asking select Data server name and TNS.I typed Oracle for Data Server Name and IN TNS what to type? I pulled the list for TNS
base calculator.. - Java Beginners
base calculator..  need some help!!! I cant install jcreator properly?? there's always an error (Error : Invalid path, "C:\Program Files\Java\jre1.6.0_01\bin\javac.exe" -classpath "C:\Program Files\Java\jdk1.6.0_01\bin" -d "C
Lang and Util Base Libraries
Lang and Util Base Libraries The Base libraries provides us the fundamental features and functionality of the Java platform. Lang and Util Packages Lang and Util package provides the fundamental classes and Object of primitive type
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
Data base related question
Data base related question  sir my table has only one element(that is pno),i am using ms-access as backend. i put only one element i want to retrieve that element .how can i retrieve that element,using jdbc technology. please
Other Base Packages
Other Base Packages I/O For handling i/o of an application in java , java.io & java.nio package is available. Object Serialization Object Serialization provides the of objects' encoding into the stream of byte and also
JSP data base validation
JSP data base validation  please explain how to validate form input string with database n also how its notify that entered data exists already .please reply soon   hi friend, <%@ page language="java" contentType
Mysql Decimal Datatype
Mysql Decimal Datatype       Mysql Decimal Datatype is used to specify the numeric values. Understand with Example The Tutorial give you an example from 'Mysql Decimal Datatype
Convert Decimal to Integer
Convert Decimal to Integer       In this section, you will learn to convert  a decimal number... a decimal number to an integer type number. Description Code: This program helps you
What is the base class of all classes?
What is the base class of all classes?  Hi, What is the base class of all classes? thanks   Hi, The base class is nothing but the Abstract class of Java programming. We uses the syntax for base class of all
How to round a number to n decimal places in Java
How to round a number to n decimal places in Java  How to round a number to n decimal places in Java
Tutorials