How to Converto from Scientific Notation to a Two decimal float in VBA for RW

Posted on 2009-02-12
Last Modified: 2012-05-06
i'm using VBA in RW and when i divide two strings using the val function, i get the result in scientific notation and i want them in a two decimal float, how do it.

I think thare are two ways, in the RW using the format option of the calculated field or in VBA, both are fine with me, but i don't know how to do it either way.

I attached the code i've used in VBA.


Dim quantity as double

quantity = val(Qtytoinvoice.value) / rs("m")

'this gives me a number in scientific notation

msgbox quantity,vbokonly

Open in new window

Question by:lguifarro
    1 Comment

    Accepted Solution


    I've used the format function, format(expression,"########.##") and it did the trick



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now