Click here to Skip to main content
6,822,123 members and growing! (18,622 online)
Email Password   helpLost your password?
Languages » XML » XML/XSLT     Advanced License: The Code Project Open License (CPOL)

XSLT Number to String Transformation II

By Mahendra Kumar Srivastava

XSLT Number to String Transformation for Hindi Language
XML, XSLT, Architect, Dev
Revision:3 (See All)
Posted:2 Jul 2009
Updated:17 Jul 2009
Views:2,785
Bookmarked:3 times
Unedited contribution
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
4 votes for this article.
Popularity: 2.21 Rating: 3.67 out of 5
1 vote, 25.0%
1

2
1 vote, 25.0%
3

4
2 votes, 50.0%
5
NumberTransformationInHindi

Introduction

Just an addition to previous version of this XSLT transformation. It is in Hindi so may be some of the international developers not familier with Hindi language may find it difficult to understand the result. 

Background

People unfamiliar with India’s traditional numbering system may find this challenging. The system used in India, Pakistan, and Bangladesh is based on a unique grouping of two decimal places, rather than three decimal places common in the West. During business dealings in India, people are likely to come across the numerical terms Arab, Crore, and Lakh (see table below), although the higher numbers listed are rarely used. These more common words are often used in combination, e.g., one Lakh Crore, which is 1012, or one trillion. The terms Padma and Kharab are sometimes used in Hindi.

India’s unique number system

Term Figure

No of zeros

Western system (short-scale)

लाख 1,00,000

5

100000 (100 thousand)

करोड़ 1,00,00,000

7

10,000,000 (Ten million)

अरब़ 1,00,00,00,000

9

1,000,000,000 (One billion)

खरब 1,00,00,00,00,000

11

100,000,000,000 (100 billion)

नील 1,00,00,00,00,00,000

13

10,000,000,000,000 (10 trillion)

पद्‌म 1,00,00,00,00,00,00,000

15

1,000,000,000,000,000 (One quadrillion)

शंख 1,00,00,00,00,00,00,00,000

17

100,000,000,000,000,000 (100 quadrillion)

महाशंख 1,00,00,00,00,00,00,00,00,000

19

10,000,000,000,000,000,000 (10 quintillion) 

Using the code

Make your XML document as in the specified format given below. Put a stylesheet reference to your XML and open the XML in a web browser (in this XML, # represents a digit): 

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="TransformNumber.xslt" ?>
<numbers>
    <number>#########</number>
    <number>####</number>
    <number>####</number>
    <number>#</number>
    <number>###########</number>
    <number>#####</number>
</numbers>		

Points of Interest

The XSLT file in this project can help you understand calling recursive templates, and also gives an idea about how to use in-built functions. We can use this as a base and can design our own XSLT for the English number system translation.

<form name="aspnetForm" method="post" action="displayarticle.aspx" id="aspnetForm" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">
</form>

History

Follow up from previous version of the article. 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Mahendra Kumar Srivastava


Member
Started carreer with CEERI, Delhi, India as a C Programmer in 2004 and migrated my learning experiance to C#.Net in 2005 with DIGISIGN Noida, Joined Bally in 2006, worked with JK Technosoft since Jun 2007 till Apr 2009, joined back Bally in June 2009. Worked in different domains such as Casino Management, Digital Signage, and Medical.
Occupation: Software Developer (Senior)
Company: Bally Technologies
Location: India India

Other popular XML articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 4 of 4 (Total in Forum: 4) (Refresh)FirstPrevNext
GeneralMy vote of 1 Pinmemberpita200022:34 2 Jul '09  
GeneralShould have been better if... PinmemberPriyank Bolia21:22 2 Jul '09  
GeneralRe: Should have been better if... PinmemberMahendra Kumar Srivastava1:24 17 Jul '09  
GeneralRe: Should have been better if... PinmemberPriyank Bolia1:39 17 Jul '09  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads.

PermaLink | Privacy | Terms of Use
Last Updated: 17 Jul 2009
Editor:
Copyright 2009 by Mahendra Kumar Srivastava
Everything else Copyright © CodeProject, 1999-2010
Web22 | Advertise on the Code Project