Thanks:  0
Likes:  0
Dislikes:  0

# Thread: Currency Format \$999,999,999.99..............****** ***********

1. ## Currency Format \$999,999,999.99..............****** ***********

Hi,

I hope someone help me out.

I have to get the exact format like \$999,999,999.99, is there any built in function available for format currency.

------------------
Satya

2. ## Re: Currency Format \$999,999,999.99..............****** ***********

u can check out the getformattedtext method

let me know

PT

3. ## Re: Currency Format \$999,999,999.99..............****** ***********

I used GetFormattedText but doesn't workout..is there any builtin function available in Silk?

------------------
Satya

4. ## Re: Currency Format \$999,999,999.99..............****** ***********

I don't know of any built-in function.
You may have to play around with these functions: (see Online Help for details)

Stuff ()
StrTran ()

5. ## Re: Currency Format \$999,999,999.99..............****** ***********

Well, I'm not certain what you have to work with, but given there is a text field of some sort that presents you with retrievable text, you can "get" that string and compare it character by character against a known quantity. I use something like:

[+] Boolean StringCompare (String Str1, String Str2)
[ ] Boolean bGood = True
[ ] String sTrim1
[ ] String sTrim2
[ ] Integer iLength
[ ] Integer i
[ ]
[ ] sTrim1 = Trim(Str1) //Lose the white space.
[ ] sTrim2 = Trim(Str2)
[ ] iLength = Len(sTrim1) // Get the length of the first string.
[-] if (iLength == Len(sTrim2)) // If the length/character count of each string is the same, check each character.
[-] for (i = 1; i <= iLength; i++) // Walk the string.
[-] if (sTrim1[i] != sTrim2[i]) // If character[i] is not the same in each string, we have a problem.
[ ] _LogError("FAILURE! The characters don't match at character {i}")
[ ] bGood = False
[+] else
[ ] _LogError("FAILURE! The string/line is a different length; String = {iLength}, List2 = {Len(sTrim2)}.")
[ ] bGood = False
[ ]
[ ] return bGood
[ ]

6. ## Re: Currency Format \$999,999,999.99..............****** ***********

If what your looking for is a way you can format values into the format \$##,###.##, so that you can use that for comparing, here is a function for you

------------------
David Genrich
Blackhog
932 Hamlin Court
Sunnyvale, CA 94089
dgenrich@blackhog.com

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.