TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vinnu
NA
61
201.9k
please correct the code (indian number format code)
Nov 4 2010 3:19 AM
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
[code]
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
[/code]
please modify the code .. the code is in ssrs report properties->code tab..
help me...
Reply
Answers (
1
)
viewing ssrs reports in another system
correct the code(indian currency format in words)