Phil; There's probably a few ways to do this, using the string
manipulation functions (see Help > Reference > SPARQL Functions
Overview). The following regex will add all of the commas:
LET (?x := smf:regex(?w, "(?<=\\d)(?=(\\d{3})+(?!\\d))", ","))
...and you can use a fn:concat to add the dollar sign.
-- Scott
On Apr 12, 9:53 am, Phil <[email protected]> wrote:
> We are producing some aggregate reports within the TopBraid Ensemble
> tool. One of these reports performs a sum of Purchase Order spend
> over a property whose object is of type "xsd:decimal". Unfortunately,
> the result is a fairly large number with no comma separators, which
> makes the output fairly difficult to read. Is there a way (perhaps
> via smf:regex) that we could add comma separators to the result? I've
> done some searching on the web for regex strings that would do this,
> but I can't seem to get them to work in a SPARQL statement that
> includes the string inside an smf:regex function.
>
> Thanks,
> Phil
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en