I am writing C# solution that generates a C++ file base on some configuration. For this i am using Scriban as a template engine. I saw the following statement before in Jinja2:
uint16_t {{"%25s"|format(device.name)}} = {{"0x%08x"|format(device.address)}};
device.name is a string and device.address contain Hexadecimal value (0x50060800).
I tried this:
uint16_t {{device.name | object.format "%25s"}} = {{device.address | math.format "0x%08x"}};
And i received the following error:
<input>(15,50) : error : Unexpected `RNG`. Must be a formattable object
<input>(15,71) : error : Unexpected `0x50060800`. Must be a formattable object
This is the result I was expecting:
uint16_t RNG = 0x50060800;
How can I implement the above statement in Scriban?