Home > Community > Forums > PCB SKILL > Floating number to String conversion

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Floating number to String conversion 

Last post Fri, Jun 15 2012 1:58 AM by Pawandeep. 2 replies.
Started by Pawandeep 15 Jun 2012 12:51 AM. Topic has 2 replies and 1828 views
Page 1 of 1 (3 items)
Sort Posts:
  • Fri, Jun 15 2012 12:51 AM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Fri, Oct 14 2011
    • Singapore, 00-SG
    • Posts 106
    • Points 1,675
    Floating number to String conversion Reply

    Hello,

    How to convert a floating type number to string like 123.111 to "123.111" while doing string manupulations?

    The functions like concat ---Concatenates strings, symbols, or integers into a single symbol only--- but not floating numbers.

    Is there any workaround to get the String of floating number?

    Pawan

    Filed under:
    • Post Points: 20
  • Fri, Jun 15 2012 1:46 AM

    • pcbnagaraj
    • Top 150 Contributor
    • Joined on Tue, Dec 6 2011
    • bangalore, Karnataka
    • Posts 55
    • Points 1,130
    RE: Floating number to String conversion Reply
    Try using sprint will convert to string

    sprintf( a " %f" 123.111)

    Thanks,

    Nagaraj.
    • Post Points: 5
  • Fri, Jun 15 2012 1:58 AM

    • Pawandeep
    • Top 75 Contributor
    • Joined on Fri, Oct 14 2011
    • Singapore, 00-SG
    • Posts 106
    • Points 1,675
    RE: Floating number to String conversion Reply
    Awesome!!!

    Thanks Nagaraj
    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by Pawandeep at 15 Jun 2012 12:51 AM. Topic has 2 replies.