Microsoft Dynamics GP Developing for Dynamics GP
A blog dedicated to the Microsoft Dynamics GP Developer & Consultant community
 
Welcome to MSDN Blogs Sign in | Join | Help

Developing for Dynamics GP

by David Musgrave (Australia) and the Microsoft Dynamics GP Developer Support Team (USA)

News

  • Please use the Blog Feedback? - Contact Us link at the top of the page to email questions relating to the blog itself.

    If you wish to ask a technical question, please use the links below to ask on the Newsgroups. If you ask on the Newsgroups, others in the community can respond and the answers are available for everyone in the future.

    Please do not use comments on pages and posts to ask questions unrelated to the topic on that page or post.



    Dates of Interest:

    11-Jul-2008: Blog Created by David Musgrave.
    10-Oct-2008: First Post by Scott Stephenson.
    04-Nov-2008: First Post by Dave Dusek.
    11-Nov-2008: First Post by Beth Gardner.
    28-Nov-2008: First Post by Chris Roehrich.
    30-Dec-2008: First Post by Patrick Roth.
    24-Feb-2009: First Post by Greg Willson.
    22-Apr-2009: First Post by David Clauson.
    04-May-2009: First Post by Ryan Wigestrand.
    19-Jun-2009: First Post by Dawn Langlie.
    03-Jul-2009: First Post by Emily Halvorson.
    23-Sep-2009: Created Twitter account with blog feed.



    WorldMaps Statistics since
    24-Feb-2009:




    Click for WorldMaps Stumbler



    Translator Tool:




    Social Networking

    Follow David Musgrave and the blog on:

    David Musgrave on Twitter

    David Musgrave on LinkedIn


    Disclaimer

    This blog is provided "AS IS" with no warranties, and confers no rights.

    The links in this blog may lead to third-party Web sites. Microsoft provides third-party resources to help you find customer service and/or technical support resources. Information at these sites may change without notice. Microsoft is not responsible for the content at any third-party Web sites and does not guarantee the accuracy of third-party information.

Contents

Favourite Posts

Blog Links

Newsgroups Links

Resources Links

RW - Getting RW_ConvertToWordsAndNumbers() to show cents in words

David Meego - Click for blog homepageA little while ago I wrote an article about how to get the RW_ConvertToWordsAndNumbers() report writer user defined function to work correctly for both originating and functional currency views. Today, a comment was added to that article asking about how to get the RW_ConvertToWordsAndNumbers() function to return the cents in words rather than numbers.

Usually the function will convert the dollar amount into words but the cent amount is shown as numbers.

For example: Using the amount 1,234.56 and the currency ID Z-US$ will return:

One Thousand Two Hundred Thirty Four Dollars and 56 Cents

However, the request was to get the following, with the cents in words:

One Thousand Two Hundred Thirty Four Dollars and Fifty Six Cents

None of the available Report Writer (RW) functions which can convert amounts to words can achieve this result. So...


I decided to write some Dexterity code (using the Runtime Execute window in the Support Debugging Tool) to manipulate the values returned from the function to achieve the desired end result. This code is written only using RW functions so it can be transferred to calculated fields in the report writer easily.

The concept is to separate the dollars amount from the cents amount and then pass the cents amount to the function as though it was a dollar amount.  We then take back the resulting strings and splice them back together to get the result we wanted. 

Dexterity Code

I then took the same logic and formulas into report writer as calculated fields and created an updated version of the report from the original post (see attached).

Please see the link below for the original article:

RW - Getting RW_ConvertToWordsAndNumbers() to work with multi-currency

An example package of the v10.0 POP Purchase Order Other Form is attached at the bottom of the article. 

Hope you find this useful. 

David

Posted: Wednesday, July 08, 2009 9:00 AM by David Musgrave
Attachment(s): POP Purchase Order Other Form.zip

Comments

Vaidy said:

Thanks David.

I was referring this function to one of my friend and the same gap was reported by him. I could not give him any solution for that as I was involved in a different task.

This was badly needed by him and I can now deviate him to this article.

Thanks

Vaidy

# July 9, 2009 6:03 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker