Formatting of decimal data type

The standard install of the EDI module has decimal types formatting to #.#####E0 .

This is causing a problem with one of our trading partners. They simply want us to switch the formatting off.

I don’t see why this would cause any problems. But I’m hesitating because the manual says you shouldn’t touch the external formatting as it does comply with x12. Plus you never know… the next trading partner may want it switched on!

Is there any way to override the formatting performed by convertToString without getting into the “Configure Field Formats” in the admin browser??

Thanks for any advice!

Mark,

Those formats make some assumptions that the rest of the world doesn’t.
In the past I’ve gone into the schema dictionary are removed them completely but this creates the problem managing this as you upgrade and migrate environments. The other method is to delete them from the format.xml file. If you’re upgrading from 4.6 to 6.XX the upgrade guide recommends that you do this or redo your mappings to conform to the new formats.

I recently did a new 6.1 implementation and contacted tech support. Here is their reply:
change the file WmEDI/config/format.xml

Change

    <FormatService  
            name="formatDecimal"  
            isEnabled="true"  
            internalFormatString="#.##########"  
            externalFormatString="#.#####E0"  
            applyFormat="true"/>  

to

    <FormatService  
            name="formatDecimal"  
            isEnabled="true"  
            internalFormatString="#.##########"  
            externalFormatString="#.##########"  
            applyFormat="true"/>  

So take your pick on the method you need. Note that the above solution by Tech support does not address the formats of N2. I find in some instances it adds 2 trailing zeroes which totally changes the value of the number.
Anyway pick which method works for you.

HTH

Mark,

we have also choosen this format as Chris mentioned above.
<FormatService
name=“formatDecimal”
isEnabled=“true”
internalFormatString="#.##########"
externalFormatString="#.##########"
applyFormat=“true”/>

af of now we havent seen any formating issues as such.

HTH,
RMG

Thanks guys! I appreciate it. I will make said change and not loose any sleep.

At first I was going to set applyFormat to false. But changing the externalFormatString makes more sense. I guess that will at least ensure a numeric value.

Hi,
i am new to webMethods ,i would like to know regarding the formatting services in detail? why we use them ? how to use them ? one field is like number(10,2),max length is 11,please explain to this situation ?

thanks in advance

HI Bachi,
There are a lot of format services provided by webmethods. In the EDI package (if you have installed EDI module at the time of installation) you can find format services like formatN0, formatN1,formatN2 and so on. For example formatDecimal Service gives you a formatted value of 1.02345E1 with an input value of 10.2345. If you use formatN1 service and if your input value is say 10.234 the formatted value output will be 102. These services are used to have the output values where decimals are not allowed like in case of your output is going to a gentran system it doesnot accept decimals. In most of the EDI schemas you create using SEFParse service these format services will already be there. Hope this clarifies youa lil bit.

Regards,
Pradeep.

Hi Bachi,
Forgot to mention there are also formatDate and Time services. The output of these services is dependent on your format.xml page in the \webMethods6\IntegrationServer\packages\WmEDI\config folder. You have to change your internal format strings for change in the output format. FOr example in my format.xml <formatservice> . ExternalFormat String is the input you give and internal Format String is the output we get. If you want you can change the internal format and reload the package to affect the changes.

Regards,
Pradeep.

hi pradeep ,
thanks for ur replay.here what we have to use ie convertToValues or ConvertToString ? and if i want get back by original value how to do it ? here in ex 102 to 10.234?

thanks in advance

Hi

I am using formatN2 (EDI: Util: FormatServices.formatN2) Service in Tradacoms Adapter, This Service Converts NNNN.NN values to NNNNNN.
But this service is behaving different with some cases

Example:
1296.59 correct values is 129659, But I am getting 129658. But other case likes
1396.59 and I am getting correct values 139659.
Please tell me how to over come this problem

Regards
Pandurang.

Regards
Pandurang

Else you can make use of replace or numericFormat servicesand remove dot with nothing.
I am not sure about Tradacom Adapter.

HTH,
RMG

how to override or bypass formatN0

You can customize that remove from Schema (formatService) of the field that uses formatN0 (WmEDI service) and copy edited schema to some custom folder and use it or Update the config from the Solutions/EDI admin home page, where the format services reference from it:

1.Open the Server Administrator if it is not already open.
2 In the Solutions menu of the navigation panel, click EDI. The Server Administrator
opens a new browser window to display the EDI Module home page.
3 From the EDI Module home page, in the Configuration menu of the navigation panel,
click Configure Field Formats.
4 Click Edit Format Settings.

and set isEnabled true or false (bypass formatting)

HTH,
RMG

It appears (EDI: Util: FormatServices.formatN2) converts NNNN.NN values to NNNNNN.

Is there a service that does the reverse? Converting NNNNNN to NNNN.NN values?