Expand my Community achievements bar.

Numeric Pattern does not work

Avatar

Level 2

Hi Experts,

Hope you can help me with this. I have a requirement to convert this amount, 1440.64 to 144.064,00. I have already set the Display pattern to zzz,zz9.99 but in the output it still incorrect, 1.440,64. Note that I've set the locale to German(Germany).

Hope anyone can give me explanation on this?

Appreciate your response here.

Regards,

Dennis

16 Replies

Avatar

Level 2

Hi Experts,

Hope anyone can help me with this.

Regards,

Dennis

Avatar

Level 2

Hi Experts,

Any response from you?

Appreciate your response.

Regards,

Dennis

Avatar

Level 6

As the name suggests Display pattern is just for display and Edit Patrn is to force users to follow data entry pattern......however you need to set Data Pattern under Object>>Binding tab to get what you need in output.

Good luck,

Avatar

Level 2

Hi Varma,

Thanks for this. I've tried your comment but sad to say it still not working..I've forced the data pattern to zzz,zz9.99 and it still not outputting correctly.

Any other suggestions?

Regards,

Dennis

Avatar

Level 6

I do not get it where it fails....is it possible to email a copy to n_varma(AT)lycos.com and give details of the field....also give some examples data and expected output for that field. If this method fails we have to force the data manipulation using Script.

Avatar

Level 2

Hi Varma,

YGM. Sorry for my late reply.

Appreciate your response here.

Regards,

Dennis

Avatar

Level 2

Hi Experts,

The problem still occurs... Any other idea on this?

Appreciate your responses here.

Regards,

Dennis

Avatar

Level 6

I can help you if you could email the copy of your PDF/XDP template. The word document that you sent me earlier is no good for me to investigate.....

Avatar

Level 2

Hi Varma,

Sent you a mail.

Thanks in advance.

Regards,

Dennis

Avatar

Level 6

I have sent you email with the copy I made changes to..... but here are some key changes I made.

Save your master copy before you make change to your copy just incase.....

Here are the steps I have followed to make it work the way you wanted.....

1. Copy in the F_Item_Netwr field in designer and paste it in the same spot....designer will add this in some location in the same subform....you can rearrange the objects in Hierarchy pallet

2. Renamed the new object and set following properties...

    Name: F_Item_NetwrHid

    Type: Decimal Field

    Limit Trailing Digits Max: 2

    Visible: Hidden from Layout

    Locale: German (Germany)

    Visible Pattern: <Blank>

    Edit Pattern: <Blank>

    Data Pattern: <Blank>

    Default Binding: None

3. Now select the F_Item_Netwr and change it to TextField rather than Decimal Field

    Note: This is important to retain the output format

    Visible: Visible

    Locale: Default Locale
    Visible Pattern: <Blank>

    Edit Pattern: <Blank>

    Data Pattern: <Blank>

    Default Binding: $record.ITEM.DATA[*].NETWR

4. And then add following FormCalc code under "initialize" or "docReady" event for F_Item_Netwr (do not need same code under both events.....)

if (At($.rawValue,",")>= 1) then
$.rawValue = $.rawValue
else
$.parent.F_Item_NetwrHid.rawValue = Replace($.rawValue, ".", "")
$.rawValue = Concat("", Replace($.parent.F_Item_NetwrHid.formattedValue, ".", "-"), ",00")
endif
$.rawValue = Replace($.rawValue, "-", ".")

You may save the copy and test the results......following is done for my testing.....as I do not have sample XML to feed.

5. Supply various default values like 1440.64, 123451440.64 for F_Item_Netwr to see the change in results.....save the template each time and verify the results.

Hope that helps, Good luck,

Avatar

Level 2

Hi Varma,

Sent you an email.

I've applied your steps and it worked! But I just noticed somethings. In the F_Item_Netwr, there were 2 values captured, 1440.64 and 6000.00. In my output after applying your fix, only the 144,064,00 is displayed and not the 600,000,00.

And also, the germany locale is not applied. The output is in 144,064,00 where it should be 144,064.00.
And one more thing. I'm not pretty sure about this but should I also change the xml format if I'll be applying this to another field like field F_Item_Tot_Netwr and F_Item_Netpr? Coz when i reviewed the xml you provided, there are some adjustment made for F_Item_Netwr.
Kindly clarify on this.
Hope to hear your feedback on this matter.
Regards,
Dennis

Avatar

Level 2

Hi Varma,

Sent you an updated mail.

Here's another update. I managed to apply it for field F_Item_Tot_Netwr but I'm having problem with applying it to F_Item_Netpr.
I'm getting a no display of value whenever i apply it to field F_Item_Netpr. Do you have any idea about this?
Attached here is the updated XML version I'm using.
Appreciate your response here the soonest.
Regards,
Dennis

Avatar

Level 6

I just checked your attached XML I did not found any updates related to F_Item_Netpr.

But the updates you made for other two fields look good.

You are almost there and it is hard to help with these kind of issues...repeat the same process for F_Item_Netpr you should see the expected results....

Avatar

Level 2

Hi Varma,

Good day to you!

YGPM.

Appreciate your response here.

Regards,

Dennis

Avatar

Level 2

Hi Varma,

Hoping for your response on this.

Regards,

Dennis

Avatar

Level 2

Hi Varma,

Hoping you reponse here.

Regards,

Dennis