This post was originally published here

It’s been a while since I don’t make any changes to one of my favorite pet projects: BizTalk Mapper Extensions UtilityPack! Today I’m happy to announce the release of a new BizTalk Functoid: Convert to a Number Functoid.

Note: And it will not be the only one, soon I will release two new Functoids that I’m working on.

Today I was working on a map that I had the need to transform several numbers delivers in a string with a decimal format:

  • 1.000
  • 121.000

to an Oracle NUMBER(x) – without decimals.

Initial, I thought in create a Scripting Functoid and reuse it inside the map for each element. However, I realize that I will have to use the same transformation in different maps… so I end up creating this simple Functoid.

Convert to a Number Functoid

This functoid allows you to convert a string to a number (integer)

Parameters

The functoid takes three mandatory input parameters:

  • The input value to be converted to a number;
    • 1.0000
    • 1.000,00
    • 123,10
  • A character that describes what is the decimal separator (can be empty);
  • A character that describes what is the group separator (can be empty);

The output of the functoid will be a Number (integer), example: 1234

BizTalk-Server-Convert-to-Number-Functoid

In this sample described in the picture above we are receiving a string with a decimal: “1.000” and we want to transform into “1”. So, in this case, the functoid configuration will be:

  • the first input will be our value;
  • the second input will be “.” (dot) that describe the decimal separator;
  • and the third input will be “” (empty) because there isn’t any group separator (delimitator);

BizTalk Mapper Extensions UtilityPack: Project Description

BizTalk Mapper Extensions UtilityPack is a set of libraries with several useful functoids to include and use it in a map, which will provide an extension of BizTalk Mapper capabilities.

Where to download?

You can download this functoid along with all the existing one on the BizTalk Mapper Extensions UtilityPack  here:
BizTalk Server Community Extensions Utility Packs GitHub Repository
GitHub

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community. View all posts by Sandro Pereira