VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Number to Text Up to Billions with Bonus Uppercase (Updated)

by Jose Ramirez (3 Submissions)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

That's right, all positive long values up to 2147483647. This simple algorithm can translate any positive long value to its string equivalent, both English and Spanish. The principle is simple: Process three digits at a time because the cycle is repetitive every three digits. The only thing you have to append every time is the order qualifier: Thousand, Million, or Billion. The code of the main function is commented, and the other functions are just plain very easy, so no commenting there. The user interface shown here is very simple because the object of this post is the functionality! :) BONUS: Included (and made just for fun) there is a custom uppercase function. It was programmed under the principle that switching between lower and upper case, all you have to do is flip bit &H20. It also writes to the source string directly by mapping an array to the string buffer (advanced stuff). I did not benchmark, but supposedly, this upper case method should be a lot faster than regular string manipulation, although I don't know if it is faster than the VB upper case function. If you want to implement this in one of your applications, all you have to do is drop the module in. Please vote and comment.
UPDATE: Run-time error 9 in uppercase function solved. It was a silly error.

Rate Number to Text Up to Billions with Bonus Uppercase (Updated)

Download Number to Text Up to Billions with Bonus Uppercase (Updated)

Download Number to Text Up to Billions with Bonus Uppercase (Updated) (50 KB)

Number to Text Up to Billions with Bonus Uppercase (Updated) Comments

No comments have been posted about Number to Text Up to Billions with Bonus Uppercase (Updated). Why not be the first to post a comment about Number to Text Up to Billions with Bonus Uppercase (Updated).

Post your comment

Subject:
Message:
0/1000 characters