[Gambas-user] Format

Benoit Minisini gambas at ...1...
Sat Sep 11 17:42:59 CEST 2004


On Friday 10 September 2004 23:00, Mr JH Deval wrote:
> Sorry to be a bother today but I am looking for a
> replacement to this.
>
> VB Command
> FixPhone = Format(PhoneNum, "(###) ###-####")
> Returns (444) 444-4444
>
> Gambas Command
> FixPhone = Format(PhoneNum,"(###) ###-####")
> Returns (4444444444) ###-####
>
> I have a temporary solution using the mid but that is painful.
>

Check the Subst() subroutine too:

FixPhone = Subst("(&1) &2-&3", Left(PhoneNum, 3), Mid(PhoneNum, 4, 3), 
Mid(PhoneNum, 7, 4))

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list