[SOLVED] Problem with strcat()

Status
Not open for further replies.

Okada

Banned
Joined
Jun 16, 2016
Messages
1,159
Helped
129
Reputation
252
Reaction score
129
Trophy points
63
Activity points
0
Hi

I have Problem with strcat()

Find attached mikroC PRO PIC project and Proteus simulation file.

Press A button and it will show "Set frequency"

Frequency will be 100.00MHz

Now use B or C button to decrement or increment the value and then make again value 100 then it shows 100.0MHz instead of 100.00MHz.

Please tell me how to solve this problem. I have spent 2 hours finding a solution for it but it is not working. What ever method I use it prints 100.0MHz after first use.

It is my clients requirement that it display 100.00MHz that is two digits after decimal point.

I am using float2ascii.h which is provided by edaboard member paulfjujo.
 

Attachments

  • FM Transmitter.rar
    125.8 KB · Views: 43

@Easyrider83

There is no printf in mikroC PRO PIC but there is sprintf(). I tried it with your suggestion but not getting the required result. Should I use %.2f instead ?

Edit: Thank you Easyrider83

Your method worked with sprintf() and %.2f formatter.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…