Mohammad
Mohammad

Reputation: 57

How to turn a float number like 1.56783 into 1.567 in FreeFem++

I want to save the number 1.56783 as 1.567 in FreeFem++ thanks.

Upvotes: -1

Views: 154

Answers (1)

quemeful
quemeful

Reputation: 9868

In most programming languages this will work if there is not such rounding function.

multiply by 1000
round to the nearest integer
divide by 1000

Upvotes: 1

Related Questions