Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 24th, 2008, 06:27 AM
Registered User
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Indian Rs Format simple Function for vb.net


    Function IndianFormat(ByVal tempnumber As Double)
        Dim tnumber As Double
        Dim NegativeNo As Boolean
        Dim tempno As String = ""

        If tempnumber >= 0 Then
            NegativeNo = False
        Else
            NegativeNo = True
        End If

        tnumber = Math.Abs(tempnumber)
        Select Case Len(Format(tnumber, "#########0.00"))
            Case Is <= 6
                TempNo = Format(tnumber, "###0.00")

            Case Is = 7
                TempNo = Format(tnumber, "#\,##0.00")

            Case Is = 8
                TempNo = Format(tnumber, "##\,##0.00")

            Case Is = 9
                TempNo = Format(tnumber, "#\,##\,##0.00")

            Case Is = 10
                TempNo = Format(tnumber, "##\,##\,##0.00")

            Case Is = 11
                TempNo = Format(tnumber, "#\,##\,##\,##0.00")

            Case Is = 12
                TempNo = Format(tnumber, "##\,##\,##\,##0.00")

            Case Is = 13
                TempNo = Format(tnumber, "#\,##\,##\,##\,##0.00")

            Case Is = 14
                TempNo = Format(tnumber, "##\,##\,##\,##\,##0.00")

            Case Is = 15
                TempNo = Format(tnumber, "#\,##\,##\,##\,##\,##0.00")

            Case Is = 16
                TempNo = Format(tnumber, "##\,##\,##\,##\,##\,##0.00")

        End Select

        If NegativeNo = True Then
            Return ("(" & Trim$(tempno) & ")")
        Else
            Return (Trim$(tempno))
        End If



    End Function






Similar Threads
Thread Thread Starter Forum Replies Last Post
wizard format using VB.NET jomet .NET Framework 2.0 2 March 6th, 2008 05:19 AM
simple MSSQL queries and VB.NET bluHatter ASP.NET 2.0 Basics 34 September 6th, 2007 03:24 PM
(VB.net): Input string was not in a correct format sandeepyadav VB.NET 2002/2003 Basics 1 November 10th, 2006 11:18 AM
Indian Currency Format In ASP CurrencyINR( ) tks_muthu Classic ASP Basics 0 July 28th, 2006 01:41 AM
Simple ASP.NET message box with VB janicen General .NET 1 February 24th, 2005 03:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.