Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. Wierd Message Format

Wierd Message Format

Scheduled Pinned Locked Moved Java
questioncomhelptutorial
1 Posts 1 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brian Van Beek
    wrote on last edited by
    #1

    Ok..just wondering if anyone else has run into this problem. At work we are building return url's to send to different apps. For this we use MessageFormat.format. for example l_url = MessageFormat.format( l_url, new Object[] { "fooProcessing?foo=true", getUrlInfo(), getDeployment(), l_userId, l_returnJsp}); In this example, l_userId is of the object type Integer. Now, lets say for a moment that my userId is 1011. Now when I call the toString() function I get returned "1011". The MessageFormat.format however is somehow formatting l_userId to be "1,011." Which as you guessed, totally blew up our return urls, as when we go to convert that userId to an Integer, it doesn't like the commas. My question is, why did it do this? Shouldn't this just call a simple toString() implicitly as we are inserting them into a string? Another question I have is, if Integer can format that way (with the comma) why can't it take a number with commas in it when creating a new Integer? Brian Van Beek My Blog is Awesome, ok maybe not, but is still fun!!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups