Skip to content

toledano/VBA-Class---Num2Char-infinite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

VBA-Class Num2Char

Welcome in Num2Char

Num2Char is an 'inifinite' number to literal supporting any languages running on any VBA applications such as:

  • MS/Word
  • MS/Excel
  • MS/PowerPoint
  • MS/Outlook
  • M/Access
  • MS/MapPoint
  • MS/Visio
  • ArcGIS (to be tested)
  • AutoCAD (to be tested)
  • Collabora (to be tested)
  • CorelDraw (to be tested)
  • Kingsoft Office Pro
  • LibreOffice (to be tested)
  • SolidWorks (to be tested)
  • WordPerfect (to be tested)
  • UNICOM System Architec (to be tested) Both in VBA7 and VBA6 in 32 or 64bits.

Usage

VBA inside can convert numbers thru format condition, but all VBA conversions are limited up to 999999999999999. After that coversion lost precision. So you can't convert in various languages easily and can't support currencies.

Num2Char is capable to transcode from unquintillion to million of decilliards in unlimited languages thru INI file can be customized. Specific gramar language rules is also managed such as difference between French from France, Belgium and Switzerland. Simple use code is:

' Init class
Set ClsConvertir = New Cls_Num2Char

' First of ALL ! Initiate used language before any other methods/Properties
ClsConvertir.INIFile = "FRA"

' Get result of class init in case of error during loading language parameters
If ClsConvertir.IsError <> 0 Then
    Err.Raise ClsConvertir.IsError
End If

' Convert
With ClsConvertir
    .Separator = NUM2CHAR_SEPARATOR.SepAsDash	' Use dash between each word to avoid frauds
    .Endings = NUM2CHAR_ENDINGS.EndBoth			' Use customizable endings to avoid frauds (checks)
    .CurrencyAs = NUM2CHAR_CURENCY.currencyname	' Use currency name instead none or currency signs
end with		
ClsConvertir.NUM2CHARConvert "123456789012345678901234567890123456789,1234567890123456789"
Debug.Print ClsConvertir.Literal

The VBA source code of testing is delivered, but VBA class itself is free of usage only in compiled mode to manage myself versions. INI files are free and you can create at your choice and register them in Windows registry.

The name of registry entries are limited at this time to:

  • FRA French
  • CHE French for Switzerland
  • BEL French for Belgium
  • USA English for United States of America ($)
  • GBR English for United Kingdom (£)
  • GER Deutsch
  • ITA Italian
  • SPA Spanish
  • PRT Portugal

Main registry entry is "HKEY_LOCAL_MACHINE\SOFTWARE\CyberLogos\VBA\Class\Num2Char", and each language have a specific entry to define INI file location (i.e. INIFileFRA for French).

Tests and Debug

Many thanks to test and debug with my Num2Char_Tests in all languages and build your test routine to give me feedback. Send me also proposal INI files for:

  • Arabic (multiple arabic rules depending countries/regions ?)
  • Chinese (multiple chinese rules depending regions ?)
  • Dutch
  • Hebrew
  • Japanese
  • Russian
  • Spanish for outside Spain (South america countries) ...

Don't forget one INI by country. INI contains both specific language rules AND specific currency.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages