get DisplyValue from Glideaggregate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 06:12 AM
Heho,
is there any chance to get the displayValue from GlideAggregate as I can get if from GlideRecord.
The thing is, that I want this number formatted. So for a German user I need: "2235,2300000"
example code:
var agg = new GlideAggregate('order_price');
agg.addEncodedQuery("some query");
agg.addAggregate('SUM', 'price');
agg.groupBy('price_type');
agg.query();
while (agg.next()) {
var sum = agg.getAggregate('SUM', 'price');
gs.info(JSON.stringify(sum,"",2));
}
Output:
"2235.2300000"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 06:16 AM
Hello @Holger Peters
You can replace the comma with a dot if you need to:
parseFloat(sum.replace(/[,]+/g,".");
Regards,
Theo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 06:26 AM
all these these later adjustments have the problem, that I need to figure out, what the current system language is... Like getDisplayValue from glideRecord already knows and does... No chance to get something like this from GlideAggregate???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 06:32 AM
I think the problem is that the browser Language dictates the decimal separator to use..
You can also use a field format to get this final results 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 06:16 AM