.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Amount in Words

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :ASP.Net
Guys, I have a problem. I have a textbox where i enter the amount and in another textbox the amount in words comes automatically. The function appended below works fine when the amount entered is without a decimal. But if the amount entered has a decimal, then the function gives an error. Can anyone check the same and tel me a solution. Wat i want is suppose the amount entered in 2345.68 the amount in words should come, Rupees two thousand three hundred forty fve and sixty eight paisa only. if the decimal is not entered then the function gives proper result. public string IntegerToWords(double inputNum) { int dig1, dig2, dig3, level = 0, lasttwo, threeDigits; string retval = ""; string x = ""; string[] ones ={ "", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen" }; string[] tens ={ "", "Ten&qu

View Complete Post

More Related Resource Links

Converting Amount into words


I have this requirement that an amount should be represented in words.

For eg: Rs. 400 should be represented as Four Hundred Rupees.

Can anyone suggest the code or links for the same?

Count words in the ascx file



I have 163 .resx files. I want to count the words in these files, because my want to translate the sentences (my task is the localisation).

Now I'm opening each file in Ms Visual Studio and I count words manually. How can I count words in all files? And the second question: can I use a program what grab strings from .resx into an editor where I can translate them and save bacn into .resx files? Or must open the files one by one and edit the text fields manually?

Thanks for helping, unfortunately I'm not a programmer.

Editor's Note: Under the Covers and Through the Words


There are some people who have little curiosity about the world around them. They drive to work without asking why their airbag light is on. They work all day, never once wondering why their computer goes through periods where it's slow as a snail.

Joshua Trupin

MSDN Magazine May 2005

search multiple words into textbox and populate all records in gridview related those keywords


I have a textbox and a gridview which is bound to a table

what I want to achieve is a solution where lets say there are two records - e.g. "1. Book and 2. Red", i want a user to type in those words and the gridview shows the results as followed;

1. Book

2. Red

I have set up the sql data source and everything and my like operator is this...

LIKE '%' + @record + '%'

how can I solve this problem?

SharePoint Workflow E-mail Hyperlink has the Spaces Between Two Words Are Removed

I have a very simple Workflow, that includes href link to Infopath form.
If the form name includes spaces, the URL redirects to a The Form has been Closed message, indicating that it cant find that form.
In our scenario, the file name of the document/form in SharePoint when saved is called "Travel Request - <submit date>"  as noted with spaces.
The Hyperlink URL in the email generated by the workflow appears to encode all values in the name after the first two words (after Request).  See below.  after the word Request the spaces are encoded properly.     its replacing the first space with it appears %0d%0a (CR LF)
The URL below is what is displayed when right clicking, and selecting Edit Hyperlink in the email

I can reproduce this in development and production.  Any ideas on how this can be resolved?

How to stored Amount into database



I have this code:

tbl_Payment tbl_Payments = new tbl_Payment()

             UserId  = UserID,
             PaymentType = DropDownList4.Text,
             AmountDeposit =AmountDeposit.Text,   ERROR!
             Date = DateTime.Now,



If the write value: AmountDeposit = 10, it works!

I have a column in the table AmountDeposit (numeric).

On what it takes to set the column AmountDeposit?




Replacing with multiple words

I have a string "The quick brown fox jumps over the lazy dog" and i want to replace a few words in the string. Like "The slow red fox climbs over the sleeping dog" I have setup a table called match with 2 fields [pattern], [Replace] with some data. quick slow brown red jumps climbs lazy sleeping How could i use the replace to achieve this? Thanks

REGEX does not match when line ends with the characters.. also, how to negate words that contain the

\S*(ai|ie)\S*   seems to match all words with characters ai and ie in them.  However it does not match if the line ends with them, how can fix that?Also, how can I match all words that DO NOT contain those characters.. I've tried ?! and [^ to no avail.Thanks in advance for any help or information!

How to find misspelled words with regex

Hi all I need a RegEx that will find a specific word within a long string. The issue is that this word may be misspelled and I need to find it even so. I would like to accept a certain percentage of wrong-ness when looking for the word. Ex. The complete string: Hello, this is my comp/et string to look at The word to search for: complete Let's say that I which to accept a maximum of two wrong letters in the above string, then the RegEx should match the word complete. However, if I only accept 1 wrong letter it shouldn't find it. Ideally the RegEx would also be able to handle whitespaces, and missing letters. Ex: The complete string: Hello, this is my com plee string to look at The word to search for: complete This should match the word as well, even though there is a whitespace between 'm' and 'p' and the letter 'l' is missing. Is this possible at all with RegEx or should I be looking at an alternative way to solve it? Thanks, Tommy

Code Camp 2010 in Words & Pictures

The Jacksonville Developer User Group pulled off an excellent code camp this weekend.  It was a great opprotunity to catch up with friends, meet new ones, and learn some good tech!  My day started off as a volunteer at the registration table.  We had a great group of volunteers...even if it was 6:30 in the morning...on a Saturday! Our welcome sign...who says you don't need a code monkey? After handing out badges, bags, and shirts for a couple hours it was off to my first class: SQL Server Complex Event Processing.  This is the new StreamInsight technology that is part of SQL Server 2008 R2.  Interesting stuff for streaming real-time data from various system...I'll need to dig into it a bit deeper. Next it was off to learn about Functional Programming and then "Becoming a Rx Pusher with the Reactive Framework".  The Reactive Framework talk was probably the most interesting of the day.  It was presented by Jim Wooley who posts at ThinqLinq.com.  The Rx framework looks extremely interesting in terms of how it handles asynchronous processing. Of course, I had to visit my friends over at PR'UF.  The PR'UF system was launched at this year's Code Camp and provides a better way to find the talented developers & architects you need.  What makes PR'UF different?  It uses reputable industry experts who

Bulk amount of data in List

Hi All, I got a requirement that to display bulk amount data in a List (Around 50000 items). Can any one of you suggest me best performance way?(Displaying this amount data would definitely leads to performance issue). Let me know if you have any Queries.   Regards, Kumar.

Find text between two separate words - to parse text from a message

Hi all, I am new to regular expressions.   The following text has got three sections; - Name, Date, and Message   [Sender]: John Smith  [Received]: 2005-8-21 3:28:9Hi bob, thanks for the message[Sender]: Paul Stein  [Received]: 2005-8-21 3:17:38Cannot make that time...[Sender]: Sarah S  [Received]: 2005-8-20 15:18:2No way! Let me know if it's on. I would love to see that film. It got great reviews.[Sender]: John Smith  [Received]: 2005-8-21 3:28:9Hi bob, thanks for the message[Sender]: Paul Stein  [Received]: 2005-8-21 3:17:38Cannot make that time...[Sender]: Sarah S  [Received]: 2005-8-20 15:18:2No way! Let me know if it's on.   I want to extract each of them.   The text between "[Sender]:" and  "[Received]:" is the NAME   The next word after the  "[Received]:"  is the DATE   The MESSAGE starts after the digits of the Date end and it is upto the mark  "[Sender]:"   Can anyone tell me how to extract it using C# Regular expressions.   Thank you for your time.   Tomy

MDX problem (Amount value is getiing doubled when multiselecting dimension parameters)

Hello...I need some help with the MDX...basically the problem is the Amount value is getting doubled when I am selecting more than one parameter. Here is situation...suppose I select a parameter  lets say A from dimension Account Element Hierarchy then I get the Budget Amount as $100, now in my SSRS report I change the dimension parameter value to B and then I get the Budget Amount $200. Now I multiselect A and B and ideally I should get the Total Budget Amount as $100+$200=$300 but in place of that I get $600 I have captured the mdx below...Please let me know if you have an idea to fix this --The below MDX returns $100 for Budget Value SELECT   NON EMPTY { [Measures].[Budget Amt], [Measures].[Budget / RSF] } ON COLUMNS, NON   EMPTY { (DESCENDANTS([Account Hierarchy].[Account Hierarchy].[Level 02].ALLMEMBERS) ) } DIMENSION   PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME, PARENT_UNIQUE_NAME, LEVEL_NUMBER ON   ROWS FROM [Finance]   WHERE (STRTOSET("{[Account Element Hierarchy].[Account Element Hierarchy].&[1214|425|406|495|1209|421]}"),   STRTOMEMBER("[Date].[Year].&[2010]"),   STRTOMEMBER("[Budget Version].[Budget Version].&[Budget]"), [Account Hierarchy].[Account Hierarchy Type].&[2])   CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR,   FORMATTED

Don't Get Me Started: Weasel Words

Euphemisms are the refuge of cowards.David PlattMSDN Magazine September 2010

Remove japnese / russian words in a String

Hi, I"m currently writing a ASP.NET MVC application in which I search twitter for new tweets. When however I use the language filter I still get some messages in japanese or russian. I tried using a Regular expression: [^\x20-\x7E\wáéíóäëiöúàêèììçù… ] which should tell me when a string contains japanese/NON ASCII characters. At least that's the output I get when I try checking this regex with a JavaScript function. This is my code: ----------- Regex languagesReg = new Regex(@"[^\x20-\x7E\wáéíóäëiöúàêèììçù… ]"); lstEntries.RemoveAll(e => languagesReg.IsMatch(e.Content)); -----------           Does anyone know why I get the right output with JavaScript functions and the wrong output in .NET? Or maybe someone might be able to help me find an other workaround? Thanks in advance Kasper

Negate predefined words using Regular Expression Validator

Hi Any one please tell a regular expression which allow all, except some predefined words. For example user should add their imaginary planet names to text field. So if he typed the existing planet names regular field validation don't allow further. i tried [^({Mercury})|({Venus})|({Earth})|({Mars})|({Jupiter})|({Saturn})|({Uranus})|({Neptune})|({Ceres})|({Ploto})|({Haumea})|({Makemake})|({Eris})] but not working. Its not working for any strings. Please tell me the correct way to do this One more thing i want to know is how lengthy expression can be given to the Regular Expression Validator. Thanks Akeeq

Enabling Enterprise Key Words for a custom list template

Hi, I have developed a list template in the usual manner, using features that create site columns, content types and then a list template that leverage's the content type.  I have a problem with Enterprise Keywords.  As this is simply a Yes/No type activation, I take it this column is slightly different from normal site columns.  When I first extracted my list template from a site with keywords activated, all I can see is that the keywords column has been added to the columns in the template.  There doesn't seem to be any setting that indicates that Managed Keywords is activated.  Regardless, I can create list instances from my template fine and the managed keywords column appears as expected.  The strange behaviour is that when I upload a new document and enter keywords for it, although these keywords are entered into the termstore, when I next view the document properties, the entries have dissapeared.  Is there something I need to do through code for this.  My problem is, as I want this setting to be enabled for a list template, How else do I activate the setting considering I cannot run code from a list template?  I hope someone can help, Cheers,   Amit
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend