Want to change font style and size after decimal point?

0
I am using a Text (common) and fetching data from backend. The data is like this "336.00". I want to change the design to something like this https://image.ibb.co/h8GdNQ/Capture.png. Basically I want to change font style and color after a decimal point and show it like a 'power of'. Please help this. I am facing issues. The way is to split and use but how to perform in mendix. Thanks in advance.
asked
3 answers
0

Hi Kavya,

Regarding the previous answer: I don't know how you save your data, if it's a standard Save microflow you could include the logic as explained by Andrej (fill 2 attributes based on 1 value), or in the same fashion, create a beforeCommit microflow which does the same.

 

If however you do not want to create and fill seperate attributes (and the element doesn't appear too often on your page, for performance reasons) you could consider the CustomString widget (https://appstore.home.mendix.com/link/app/1426/), which lets you construct a string in a microflow (the way you want it to look using Css) and display it as html. 

answered
0

Hi Kavya,

Instead of displaying the text in one text field in Mendix, split it to two strings using substring.

Then have two text fields on the page (first one until the dot, second field dot+two decimals) and use css to style them so that one is smaller and vertically aligned-top.

-Andrej

answered
0

You may consider creating an HTML string in which you style and format your text, which you could then use a widget to render (Format String, Custom String, CKeditor etc. Depending on mendix version)

answered