Double euro symbol

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
TWendt
Posts: 109
Joined: Mon Sep 08, 2014

04 Aug 2020

Hi,

I have a little problem. I use following script to calculate costs.

//Calculate Consulting
var total = 0;
var rows = fd.relatedItems(4).data('ctx').ListData.Row;
rows.forEach(function(item) {
total += parseFloat(item['Kosten.'])
total_overall += parseFloat(item['Kosten.'])
});
fd.field('Kosten_x0020_Beratungsaufwand_x0').value(Number(total.toFixed(2)).toLocaleString("de-DE", {style: "currency", currency: "EUR"}) + ' €');

The script is okay but two Euro symbols are displayed in the field.

Can you help?

Best wishes
Tom

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

05 Aug 2020

Hello TWendt,

toLocaleString method adds currency symbol when converting number so there is no need to append the euro symbol.

Code: Select all

fd.field('Kosten_x0020_Beratungsaufwand_x0').value(Number(total.toFixed(2)).toLocaleString("de-DE", {style: "currency", currency: "EUR"}));

TWendt
Posts: 109
Joined: Mon Sep 08, 2014

06 Aug 2020

Many thanks, it works.

Best wishes
Tom

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests