Click here to Skip to main content
13,767,650 members

Comments by Dipti Dhiman 3 (Top 9 by date)

Dipti Dhiman 3 21-Aug-15 8:57am View
   
Thank You Sir. But This Code didn't Worked for me.
Dipti Dhiman 3 21-Aug-15 8:56am View
   
The answers accepted in my past question were applicable if someone wants to convert number in words from database. Hence that were accepted.
But You can check my New Question, it is about the conversion after fetching the number from database and convert it to word in page.
In Chart, #VALY is giving all Y member values, and we can't convert it into Int since it works after data binding.(i.e. ConvertNumberToWord(Convert.ToInt32("#VALY")) gives #VALY and not converted to int)
Also, we cannot apply Loop because Chart Bind only once, hence accepting last converted word as tooltip for all labels of chart.
Dipti Dhiman 3 20-Aug-15 6:35am View
   
Ok Sir
Dipti Dhiman 3 20-Aug-15 4:37am View
   
Although the above answer is Correct But In order to bind the chart, i need both X and Y values which i am getting as Year and Rate (suppose 2014 and 2345689.22).

I just want to change all the rates from string(after getting from database) to Words and
want to show them in Tooltip.

I am Binding Tooltip with the help of #VALX and #VALY.
Here is my code :
Chart1.Series[0].XValueMember = "Year";
Chart1.Series[0].YValueMembers = "Rate";
Chart1.Series[0].ToolTip = "Year : #VALX \nRate : #VALY ";
Chart1.Series[0].LabelToolTip = "Year : #VALX \nRate : #VALY ";
Is anyhing Possible to convert this #VALY to Words so that all label's Tooltip would change.
Dipti Dhiman 3 20-Aug-15 4:27am View
   
Deleted
Although the above answer is Correct But In order to bind the chart, i need both X and Y values which i am getting as Year and Rate (suppose 2014 and 2345689.22).

I just want to change all the rates from string(after getting from database) to Words and
want to show them in Tooltip.

I am Binding Tooltip with the help of #VALX and #VALY.
Here is my code :
Chart1.Series[0].XValueMember = "Year";
Chart1.Series[0].YValueMembers = "Rate";
Chart1.Series[0].ToolTip = "Year : #VALX \nRate : #VALY ";
Chart1.Series[0].LabelToolTip = "Year : #VALX \nRate : #VALY ";
Is anyhing Possible to convert this #VALY to Words so that all label's Tooltip would change.
Dipti Dhiman 3 20-Aug-15 4:27am View
   
In order to bind the chart, i need both X and Y values which i am getting as Year and Rate (suppose 2014 and 2345689.22).

I just want to change all the rates from string(after getting from database) to Words and
want to show them in Tooltip.

I am Binding Tooltip with the help of #VALX and #VALY.
Here is my code :
Chart1.Series[0].XValueMember = "Year";
Chart1.Series[0].YValueMembers = "Rate";
Chart1.Series[0].ToolTip = "Year : #VALX \nRate : #VALY ";
Chart1.Series[0].LabelToolTip = "Year : #VALX \nRate : #VALY ";
Is anyhing Possible to convert this #VALY to Words so that all label's Tooltip would change.
Dipti Dhiman 3 20-Aug-15 3:05am View
   
I Used This Function :

[NumberToWords]
( @Number AS BIGINT )

RETURNS VARCHAR(MAX)
AS

BEGIN
DECLARE @Below20 TABLE
(ID INT IDENTITY(0,1),
Word VARCHAR(32))

DECLARE @Below100 TABLE
(ID INT IDENTITY(2,1), Word VARCHAR(32))

DECLARE @BelowHundred AS VARCHAR(126)

INSERT @Below20 (Word) VALUES ('ZERO')
INSERT @Below20 (Word) VALUES ('ONE')
INSERT @Below20 (Word) VALUES ( 'TWO' )
INSERT @Below20 (Word) VALUES ( 'THREE')
INSERT @Below20 (Word) VALUES ( 'FOUR' )
INSERT @Below20 (Word) VALUES ( 'FIVE' )
INSERT @Below20 (Word) VALUES ( 'SIX' )
INSERT @Below20 (Word) VALUES ( 'SEVEN' )
INSERT @Below20 (Word) VALUES ( 'EIGHT')
INSERT @Below20 (Word) VALUES ( 'NINE')
INSERT @Below20 (Word) VALUES ( 'TEN')
INSERT @Below20 (Word) VALUES ( 'ELEVEN' )
INSERT @Below20 (Word) VALUES ( 'TWELVE' )
INSERT @Below20 (Word) VALUES ( 'THIRTEEN' )
INSERT @Below20 (Word) VALUES ( 'FOURTEEN')
INSERT @Below20 (Word) VALUES ( 'FIFTEEN' )
INSERT @Below20 (Word) VALUES ( 'SIXTEEN' )
INSERT @Below20 (Word) VALUES ( 'SEVENTEEN')
INSERT @Below20 (Word) VALUES ( 'EIGHTEEN' )
INSERT @Below20 (Word) VALUES ( 'NINETEEN' )
INSERT @Below100 VALUES ('TWENTY')
INSERT @Below100 VALUES ('THIRTY')
INSERT @Below100 VALUES ('FORTY')
INSERT @Below100 VALUES ('FIFTY')
INSERT @Below100 VALUES ('SIXTY')
INSERT @Below100 VALUES ('SEVENTY')
INSERT @Below100 VALUES ('EIGHTY')
INSERT @Below100 VALUES ('NINETY')

IF @Number > 99
BEGIN
SELECT @belowHundred = antilogin.NumberToWords( @Number % 100)
END

DECLARE @NumberInWords VARCHAR(MAX)
SET @NumberInWords =
(
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)+ '-' + antilogin.NumberToWords( @Number % 10)

WHEN @Number BETWEEN 100 AND 999 THEN (antilogin.NumberToWords( @Number / 100)) + ' HUNDRED '
+ CASE

WHEN @belowHundred <> '' THEN 'AND ' + @belowHundred

else @belowHundred END

WHEN @Number BETWEEN 1000 AND 999999
THEN (antilogin.NumberToWords( @Number / 1000))+ ' THOUSAND '+ antilogin.NumberToWords( @Number % 1000)

WHEN @Number BETWEEN 1000000 AND 999999999
THEN (antilogin.NumberToWords( @Number / 1000000)) + ' MILLION '+ antilogin.NumberToWords( @Number % 1000000)

WHEN @Number BETWEEN 1000000000 AND 999999999999
THEN (antilogin.NumberToWords( @Number / 1000000000))+' BILLION '+ antilogin.NumberToWords( @Number % 1000000000)

ELSE ' INVALID INPUT' END )

SELECT @NumberInWords = RTRIM(@NumberInWords)

SELECT @NumberInWords = RTRIM(LEFT(@NumberInWords,LEN(@NumberInWords)-1)) WHERE RIGHT(@NumberInWords,1)='-'

RETURN (@NumberInWords)

and Get the Desired Result.


Thanks For Ur Help.. :-)
Dipti Dhiman 3 20-Aug-15 1:55am View
   
I Tried 'How To Convert Number into Words using Oracle SQL Query'.
But It Generates Exception as :
TO_DATE is not a recognized built in function Name. (Same For TO_CHAR).
Dipti Dhiman 3 20-Aug-15 1:55am View
   
I Tried Your Solution i.e. ConvertToWords(int number)

But,
this function Expects parameter of INTEGER type. However, I Am getting String Value from Database.

Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.181116.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid