Hi Experts,
I have one problem in Crystal report or asp.net.
when my total is 2455 then it display also in character like this,
Two thousand four hundred fifty five.
Thanks In advance,
CurrencyJitendra Patel
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted May 4, 2011, 5:42 AM EDT
If you enter 'no' to using 'and' and then enter : 125480, it should return:
One Lakh Twenty Five Thousand Four Hundred Eighty
Suthish NairRank #92 · 22.8K reputationPosted Apr 26, 2011, 5:13 AM EDT
Jitendra Patel138 reputationPosted Apr 26, 2011, 5:46 AM EDT
I have solved my problem but not in crystal report or asp.net.
I have create function in SQL Server.
please refer below link....
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=86067
I have temparory solved this problem not perment.
Thanks,
Jitendra
Suthish NairRank #92 · 22.8K reputationPosted Apr 26, 2011, 6:30 AM EDT
Jitendra Patel138 reputationPosted Apr 30, 2011, 2:12 AM EDT
Above my post(function) is not working perfectly.
So, please give me a solution.
Thanks In Advance,
Jitendra Patel
VulpesRank #55 · 29.2K reputationPosted Apr 30, 2011, 4:37 AM EDT
I also have a version for the Indian number system (lakhs, crores), which I can dig out if you need it.
Jitendra Patel138 reputationPosted May 2, 2011, 2:31 AM EDT
Enjoy this function it is work perfectly,
USE [Test]
GO
/****** Object: UserDefinedFunction [dbo].[fnNumberToWords] Script Date: 05/02/2011 15:47:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[fnNumberToWords](@Number as BIGINT)
RETURNS VARCHAR(1024)
AS
BEGIN
DECLARE @Below20 TABLE (ID int identity(0,1), Word varchar(32))
DECLARE @Below100 TABLE (ID int identity(2,1), Word varchar(32))
INSERT @Below20 (Word) VALUES
( 'Zero'), ('One'),( 'Two' ), ( 'Three'),
( 'Four' ), ( 'Five' ), ( 'Six' ), ( 'Seven' ),
( 'Eight'), ( 'Nine'), ( 'Ten'), ( 'Eleven' ),
( 'Twelve' ), ( 'Thirteen' ), ( 'Fourteen'),
( 'Fifteen' ), ('Sixteen' ), ( 'Seventeen'),
('Eighteen' ), ( 'Nineteen' )
INSERT @Below100 VALUES ('Twenty'), ('Thirty'),('Forty'), ('Fifty'),
('Sixty'), ('Seventy'), ('Eighty'), ('Ninety')
DECLARE @English varchar(1024) =
(
SELECT Case
WHEN @Number = 0 THEN ''
WHEN @Number BETWEEN 1 AND 19
THEN (SELECT Word FROM @Below20 WHERE ID=@Number)
WHEN @Number BETWEEN 20 AND 99
THEN (SELECT Word FROM @Below100 WHERE ID=@Number/10)+ '-' +
dbo.fnNumberToWords( @Number % 10)
WHEN @Number BETWEEN 100 AND 999
THEN (dbo.fnNumberToWords( @Number / 100))+' Hundred '+
dbo.fnNumberToWords( @Number % 100)
WHEN @Number BETWEEN 1000 AND 99999
THEN (dbo.fnNumberToWords( @Number / 1000))+' Thousand '+
dbo.fnNumberToWords( @Number % 1000)
WHEN @Number BETWEEN 100000 AND 999999
THEN (dbo.fnNumberToWords( @Number / 100000))+' Lakh '+
dbo.fnNumberToWords( @Number % 100000)
WHEN @Number BETWEEN 1000000 AND 9999999
THEN (dbo.fnNumberToWords( @Number / 1000000))+' Cr. '+
dbo.fnNumberToWords( @Number % 1000000)
ELSE ' INVALID INPUT' END
)
SELECT @English = RTRIM(@English)
SELECT @English = RTRIM(LEFT(@English,len(@English)-1))
WHERE RIGHT(@English,1)='-'
RETURN (@English)
END
Jitendra Patel138 reputationPosted May 4, 2011, 4:07 AM EDT
I got the Solution but it is work only in Sqlserver 2008 and 2005
Not work in 2000.................
If any idea to work in 2000 please help me...
My database in sqlserver 2000.
Jitendra Patel138 reputationPosted May 5, 2011, 12:27 AM EDT
Thanks a lots.
I shell never forget you kindness.
Thank u very much for share you knowledge.
Keep it up,
VulpesRank #55 · 29.2K reputationPosted May 5, 2011, 1:39 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted May 21, 2011, 3:23 AM EDT
VulpesRank #55 · 29.2K reputationPosted May 21, 2011, 4:36 AM EDT
Might do a quick article now that point has been confirmed.
It does seem a strange term but I found it mentioned in this Wikipedia article (http://en.wikipedia.org/wiki/Indian_numbering_system) in case you're wondering where I've got it from.