Untitled


SUBMITTED BY: Guest

DATE: Nov. 11, 2013, 4:26 p.m.

FORMAT: Text only

SIZE: 1.1 kB

HITS: 5308

  1. ?val("0,5")
  2. 0
  3. ?val("0.5")
  4. 0,5
  5. val(replace("0,5",",","."))
  6. Select Case KeyAscii
  7. Case vbKey0 To vbKey9, vbKeyBack, vbKeyClear, vbKeyDelete, vbKeyLeft, _
  8. vbKeyRight, vbKeyUp, vbKeyDown, vbKeyTab, vbDecimal
  9. Case Else
  10. KeyAscii = 0
  11. Beep
  12. End Select
  13. 'Locale support
  14. Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
  15. Const LOCALE_ICOUNTRY = &H5 ' country code
  16. Const LOCALE_SENGCOUNTRY = &H1002 ' English name of country
  17. Const LOCALE_USER_DEFAULT = &H400
  18. If getLocale <= 1 Then 'US
  19. 'use commas
  20. else 'UK
  21. 'use period
  22. End If
  23. ? val("2.500,50")
  24. 2,5
  25. ? cdbl("2.500,50")
  26. 2500,5
  27. ? val("2,500.50")
  28. 2
  29. ? cdbl("2,500.50")
  30. 2,5005

comments powered by Disqus