question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use @format with @casting like @int

See original GitHub issue

How can I use @format with @int together? For example in my settings.toml,

GPU_COUNTS = 4
num_gpus = "@int @format {this.GPU_COUNTS}"

Then num_gpus will still be parsed as strings rather than an integer.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
rochacbrunocommented, Aug 17, 2021

Hi @EdwardCuiPeacock we have been discussing this on #504 and looks like we need to bump this priority to solve the issue.

I think the plan is to change the Jinja/Format templating to wrap in parse_conf so the correct data type can be inferred.

1reaction
cutecutecatcommented, Sep 22, 2021

I met the similar situation. format + autocast is useful when inheriting config from parent structure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL Format Number with CAST, CONVERT, ROUND ...
In this article we cover different ways to format numbers in SQL Server using various functions like CAST, CONVERT, ROUND, CEILING, ...
Read more >
CAST and CONVERT (Transact-SQL) - Microsoft Learn
Using CAST with the LIKE clause. This example converts the money column SalesYTD values to data type int , and then to data...
Read more >
In Python, how to specify a format when converting int to string?
In Python, how do I specify a format when converting int to string? More precisely, I want my format to add leading zeros...
Read more >
Formatting and parsing numbers as strings - IBM
Formatting and parsing numbers as strings · From any of the string data types (BIT, BLOB, or CHARACTER) to: DECIMAL; FLOAT; INTEGER ·...
Read more >
Typecasting in C - Cprogramming.com
Typecasting is a way to make a variable of one type, such as an int, act like another type, such as a char,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found