FormatCurrency Function - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

FormatCurrency Function

NolaNola Posts: 4Member
Hi to All
I want to ask a question about FormatCurrency Function.
When I just write:
I got : FormatCurrency is a namespace and can't be used as an expression error.
But when I write:
It runs properly.

I have checked lots of programs using the function directly:
and it runs suceessfully.

Can you explain how??



  • seancampbellseancampbell Pennsylvania, USAPosts: 684Member ✭✭✭
    I had a similar issue with SqlClient.SqlConnection vs System.Data.SqlClient.SqlConnection when I was converting a project from Framework 1.1 to Framework 2.0

    I bet that the code you are reading that uses it fine without Strings. was written in a different framework then what you are writing in.

    If you want to be able to call FormatCurrency() without Strings. then type Imports Microsoft.VisualBasic.Strings at the top of your code file, (Goes about the Class declaration of the Form or above the Module declartion of a module) and that should clear things up.


    It appears that the newer versions of the framework import less sets of code, probably to cut down on memory usage. So sometimes things you could call directly in 1.1 need to be called through the proper namespace.

  • NolaNola Posts: 4Member
    I tried your solution but the result is the same.
    Any way, I will keep writing strings.FormatCurrency

    thanks a lot :)
Sign In or Register to comment.