VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Real time currency formating

by Hayrina / Tukey (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 24th December 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Real time currency formating

API Declarations


Add a new Module and Copy + Paste

Rate Real time currency formating



    
    Dim xTotal As String
    
    xTotal = Replace(Replace(xName, ",", ""), ".", "")
    If Len(xTotal) = 1 Then
        xTotal = ",0" & xTotal
    ElseIf Len(xTotal) = 2 Then
        xTotal = "," & xTotal
    ElseIf Len(xTotal) > 2 Then
        xTotal = Left(xTotal, Len(xTotal) - 2) & "," & Right(xTotal, 2)
    End If
    xName = Format(xTotal, "#,##0.00")
    xName.SelStart = Len(xName)

End Sub

Download this snippet    Add to My Saved Code

Real time currency formating Comments

No comments have been posted about Real time currency formating. Why not be the first to post a comment about Real time currency formating.

Post your comment

Subject:
Message:
0/1000 characters