Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 please correct the code (indian number format code

Author  Topic 

vinu
Starting Member

34 Posts

Posted - 2010-11-04 : 03:21:01
hi....

The code is about place the comma's (,) i.e separator between numbers
in this format (12,21,21,123) it works good..

but when there's a decimal point such as 12345.58 it will show as 12,346..
it will round up the values.. ( which i dont want that .. i want as it value to be printed )

and one more problem if there five digit with two decimal i.e(12345.00) it will show correct
i.e (12,345.00) but if i there four digit with two decimal i.e(1234.00 ) it will show this #error



Public Function FormatIndian(ByVal Amount As decimal) As String
Dim strAmount As String
Dim strGrpsArr() As String
Dim lngPos As Long
Dim lngIndex As Long

strAmount = Format$(Amount, "#")
If Len(strAmount) < 4 Then
FormatIndian = strAmount
Else
lngIndex = (Len(strAmount) - 2) \ 2
ReDim strGrpsArr(lngIndex)

strGrpsArr(lngIndex) = Mid$(strAmount, Len(strAmount) - 2)

lngPos = Len(strAmount) - 4: lngIndex = lngIndex - 1
Do
strGrpsArr(lngIndex) = Mid$(strAmount, lngPos, 2)
lngPos = lngPos - 2: lngIndex = lngIndex - 1
If lngPos = 0 Then strGrpsArr(0) = Left$(strAmount, 1)
Loop Until lngPos <= 0

FormatIndian = Join(strGrpsArr, ",")
Erase strGrpsArr
End If
Return FormatIndian
End Function


please modify the code .. the code is in ssrs report properties->code tab..
help me...

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-11-04 : 04:37:30
Your profile shows that you are opening many threads about the same problem.
Please don't do that.
- correct the code(indian currency format in words)
- please correct the code (indian number format code
- total number format in indian currency
- format the number in indian currency format



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -