parse_room

Function parse_room 

Source
fn parse_room(r: i16) -> String
Expand description

Converts a numerical room representation back into a human-readable string format.

This function is the inverse of the room parsing logic in SubmitTicket component. It converts negative numbers back to “K” prefixed rooms, numbers >= 1000 back to “D” prefixed rooms, and other numbers to their string representation.

§Arguments

  • r: An i16 representing the internal numerical representation of a room.

§Returns

A String containing the formatted room number (e.g., “K1”, “D1”, “101”).