id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

dsawyer@methacton.org string_packet_level_1 > addComma
prev  |  next  |  chance

The given string will have a length of 6 or less integer values. If the length is 3 or less, simply return that string. Otherwise return a string identical to the original except that a comma has been added between the hundredths and thousandths places.


addComma("12345") → "12,345"
addComma("987654") → "987,654"
addComma("45") → "45"

...Save, Compile, Run (ctrl-enter)

public String addComma( String str ){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy