liveBook · Manning

Data conversion

Also called type conversion, cast, coercion, convert, casting

Data conversion is the transformation of a value or data from one type, format, or representation to another, explicitly or implicitly.

How 22 Manning books explain it

Get Programming: Learn to code with Python

How it is used
Makes values suitable for arithmetic, string output, and indexing when their current types do not fit the task.
How deep it goes
Defines explicit conversions and works through results, truncation, and an invalid string; does not explain implementation internals.
Examples
Uses short int, float, and str expressions, a squared user input, whole hours from minutes, and name halves.
What you can do after
Practice/perform it by converting typed numbers for calculations and division results into usable whole-number indices.

Read how Get Programming: Learn to code with Python explains data conversion →

Essential TypeScript 5, Third Edition

Type coercion is the conversion of a value from one JavaScript type to another during an operation or expression evaluation.

How it is used
Explains unexpected JavaScript results and motivates deliberate conversion when comparing, adding, or passing values to functions.
How deep it goes
Works through operator and function results, explicit conversion, fallbacks, and a TypeScript error; defers the full abstract-equality procedure to the specification.
Examples
Uses string and numeric prices, a price-summing function, a zero tax rate, missing object properties, and a formatted tax calculation.
What you can do after
Diagnose/debug with it: distinguish concatenation from addition, preserve zero-valued fallbacks, and recognize when TypeScript rejects JavaScript coercion.

Read how Essential TypeScript 5, Third Edition explains data conversion →

100 Java Mistakes and How to Avoid Them

Type conversion is the transformation or interpretation of a value from one Java type to another.

How it is used
Prevents numeric corruption, ambiguous varargs calls, and runtime cast failures at Java API boundaries.
How deep it goes
Explains narrowing overflow, integer-division truncation, guarded reference casts, and delayed generic-cast failures without detailing conversion specifications.
Examples
Uses file-length narrowing, fractional division, Object-to-String processing, and null passed to an Object varargs method.
What you can do after
Diagnose/debug with it by checking numeric ranges, expressing intended arithmetic, and replacing fragile casts with typed APIs or guarded checks.

Read how 100 Java Mistakes and How to Avoid Them explains data conversion →

Julia as a Second Language

Number conversion is the transformation of a value from one numeric type to another related numeric type.

How it is used
Supports numeric transformations and mixed-type arithmetic, including calculations with explicit angle units.
How deep it goes
Explains explicit and implicit conversions and custom methods, while deferring a fuller treatment of parametric types.
Examples
Demonstrates integer and floating-point conversions, failed conversions, typed assignments, and conversions between radians and degrees, minutes, and seconds.
What you can do after
Build custom angle-unit conversions and apply them in mixed-unit arithmetic and trigonometric functions.

Read how Julia as a Second Language explains data conversion →

Python Workout, Second Edition

Type conversion is the transformation of a value from one data type to another, often by calling a target type as a constructor.

How it is used
Uses conversion to turn user-provided strings into values suitable for numeric comparison, arithmetic, and collection construction.
How deep it goes
Explains target-type calls, common mismatches, and two integer-validation strategies, but does not develop conversion internals.
Examples
Demonstrates number guessing, rainfall accumulation, int(), float(), str(), list(), dict(), try/except, and isdigit().
What you can do after
Apply it via Python type constructors and validation patterns to process numeric user input safely.

Read how Python Workout, Second Edition explains data conversion →

Learn Rust in a Month of Lunches

Type casting explicitly converts a value from one Rust type to another compatible type.

How it is used
Uses casting to convert between compatible types when Rust requires a specific type.
How deep it goes
Works through chained casts and a narrowing hazard without describing conversion internals.
Examples
Demonstrates converting 100 to `d` and casting 256 to `u8`.
What you can do after
Apply casting with Rust’s `as` operator and recognize that a smaller target type can change a value.

Read how Learn Rust in a Month of Lunches explains data conversion →

100 C++ Mistakes and How to Avoid Them

The transformation of a value or object representation from one data type to another, either implicitly or explicitly requested.

How it is used
Clarifies conversion intent and reduces unsafe or surprising type changes in C++ code.
How deep it goes
Explains cast categories, layout risks, and explicit conversion functions through code examples, without detailing conversion internals.
Examples
Contrasts unsafe casts, union-based binary output, and implicit versus named conversion in a Rational class.
What you can do after
Evaluate conversion choices and make intent clearer with an appropriate cast or named conversion function.

Read how 100 C++ Mistakes and How to Avoid Them explains data conversion →

Java Persistence with Spring Data and Hibernate epub

Java-to-SQL type conversion is the transformation between Java property values and SQL-compatible database values.

How it is used
Maps entity property values between Java and SQL-compatible database types.
How deep it goes
Compares built-in mappings and dialect translation, and identifies custom JPA converters and Hibernate UserType as extension options.
Examples
Illustrates numeric mappings, a Y/N boolean adapter, BigDecimal precision and scale, and a custom MonetaryAmount converter.
What you can do after
Apply it via Hibernate by selecting built-in adapters and configuring generated SQL column precision and scale.

Read how Java Persistence with Spring Data and Hibernate epub explains data conversion →

Modern C

Type conversion is the transformation of a C value from one type to another compatible type.

How it is used
Uses conversion to reconcile function arguments, expression results, pointer qualifiers, and carefully bounded memory inspection.
How deep it goes
Explains implicit and explicit conversions through code examples, but defers broader pointer and object-representation rules.
Examples
Uses a double-valued function call, pointer-conversion cases, and byte printing through an unsigned-character pointer.
What you can do after
Diagnose conversion mismatches, interpret implicit function conversions, and restrict explicit casts to justified byte-level inspection.

Read how Modern C explains data conversion →

JavaScript in Depth

The process of changing a value from one type to another according to language rules.

How it is used
Explains how JavaScript converts values across operators, conditions, comparisons, templates, and built-in methods.
How deep it goes
Works through operator-specific rules, edge cases, performance costs, and V8 representation, but defers complete conversion algorithms.
Examples
Uses payment validation, discount codes, arithmetic tables, comparison tables, sorting timestamps, and array-to-number conversion.
What you can do after
Diagnose coercion bugs, predict operator results, choose strict comparisons, and reduce repeated conversions in performance-sensitive code.

Read how JavaScript in Depth explains data conversion →

Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS

Casting is the operation of treating a value as a specified type, optionally converting it to an object of that type.

How it is used
Converts strings and other values into useful PowerShell object types or checks whether values already have a target type.
How deep it goes
Explains conversion syntax, numeric rounding, URI object properties, and Boolean type tests without developing custom type or formatting files.
Examples
Demonstrates URI casting, integer conversion after division, and string, Boolean, and datetime type checks.
What you can do after
Apply PowerShell casts with bracketed types, convert values using -as, and test types using -is.

Read how Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS explains data conversion →

Python How-To

How it is used
Converts textual input into typed values for comparisons, calculations, and further data processing.
How deep it goes
Explains numeric constructors, conversion errors, container evaluation, and manual parsing, while deferring exception handling details.
Examples
Uses age input, numeric strings, string representations of lists, tuples, and dictionaries, and comma-separated integer parsing.
What you can do after
Apply int, float, eval, or manual parsing to retrieve values represented by strings, while handling conversion failures and untrusted data carefully.

Read how Python How-To explains data conversion →

Rust in Action: Systems programming concepts and techniques

A type cast is an explicit conversion of a value from one data type to another.

How it is used
Enables numeric comparisons and conversions between time representations with different epochs and precision.
How deep it goes
Shows casts and trait-based conversions with examples, while deferring full explanations of traits and Result.
Examples
Uses an i32 and u16 comparison, a narrowing cast of 300, and conversion between chrono dates and NTP timestamps.
What you can do after
Apply Rust casts and TryInto to numeric comparisons, and use From to define conversions between representations.

Read how Rust in Action: Systems programming concepts and techniques explains data conversion →

Learn SQL in a Month of Lunches

Type conversion is the operation of changing a value from one data type to another.

How it is used
Applies explicit type changes to dates, mixed values, and SQL filtering.
How deep it goes
Explains CONVERT and CAST syntax, automatic conversion, invalid results, and sorting effects, but not conversion internals.
Examples
Demonstrates converting PublicationDate to DATE, testing invalid TitleName conversion, and sorting concatenated prices.
What you can do after
Apply CAST and CONVERT to display date-only values and recognize invalid or performance-sensitive conversions.

Read how Learn SQL in a Month of Lunches explains data conversion →

Pro Angular 16

Type coercion is the implicit conversion of a value from one data type to another during an operation or comparison.

How it is used
Uses explicit conversion to prevent unexpected arithmetic, concatenation, comparisons, and fallback behavior.
How deep it goes
Explains implicit conversion, demonstrates number-string cases, and lists conversion methods without descending into runtime conversion rules.
Examples
Demonstrates 5 + 5 versus 5 + "5", explicit number-string conversion, and fallback handling for an undefined value and zero.
What you can do after
Apply explicit conversion with toString, String, Number, parseInt, and parseFloat to control operation results.

Read how Pro Angular 16 explains data conversion →

DuckDB in Action

Type coercion is the conversion of a value or column from one data type to another compatible type.

How it is used
Corrects inferred JSON and file schemas before numeric operations or analytical queries.
How deep it goes
Explains whole-STRUCT casting, query-time failures, and Parquet physical-to-logical type mappings.
Examples
Demonstrates casting football-shot coordinates and expected goals to DOUBLE, then inspecting an ATP rankings Parquet schema.
What you can do after
Apply it via DuckDB SQL to repair inferred schemas and diagnose incompatible values before querying.

Read how DuckDB in Action explains data conversion →

Statistics Every Programmer Needs

Data type conversion is the process of changing values from one representation or data type to another.

How it is used
Prepares categorical football-play variables for decision trees and random forests.
How deep it goes
Demonstrates explicit mappings, conditional sign changes, and dtype inspection, but does not compare encoding strategies.
Examples
Uses Road/Home and Run/Pass mappings plus offensive-team score-differential sign normalization.
What you can do after
Apply it via pandas map and inspect converted columns with DataFrame.info().

Read how Statistics Every Programmer Needs explains data conversion →

Math for Web Design

Type conversion is the transformation of a value from one data type into another.

How it is used
Uses data conversion to make comparisons, layout calculations, and animation timing predictable.
How deep it goes
Explains automatic and explicit number conversion with operator examples, exercises, and common concatenation bugs.
Examples
Uses string-number comparisons, arithmetic with "5", conversion methods, and a restaurant-bill calculation.
What you can do after
Diagnose conversion bugs and apply Number(), unary +, parseInt(), parseFloat(), and strict equality.

Read how Math for Web Design explains data conversion →

Kotlin in Action, 2E

How it is used
Uses type checks and casts to select behavior for values represented through a shared type.
How deep it goes
Explains explicit casts, smart-cast stability, generic erasure, star projections, and runtime failure cases.
Examples
Demonstrates expression evaluation, numeric and string lists, star projections, safe casts, sets, and runtime cast exceptions.
What you can do after
Apply Kotlin type checks and casts while avoiding redundant casts and recognizing erased generic type limitations.

Read how Kotlin in Action, 2E explains data conversion →

Modern C, Third Edition

A cast is an explicit C conversion construct that requests conversion of an expression to a specified type.

How it is used
Deploys explicit casts mainly for exceptional low-level operations such as inspecting an object's byte representation.
How deep it goes
Explains pointer-type information loss, compiler diagnostics, and incompatible-object risks, but stops short of broader cast forms.
Examples
Uses byte inspection, incompatible pointer assignments, and conversion between object pointers and character pointers.
What you can do after
Evaluate/understand when a C cast discards type information and why character-pointer inspection is a limited exception.

Read how Modern C, Third Edition explains data conversion →

D3.js in Action, Third Edition

Type conversion is the transformation of a value from one data type to another, such as from a string to a number.

How it is used
Prepares imported CSV values for D3 visualizations by converting numeric strings into usable numbers.
How deep it goes
Explains row-by-row conversion in d3.csv(), retained keys, and formatting the complete dataset as an alternative.
Examples
Uses a technology-and-count CSV row, console inspection, and unary-plus conversion.
What you can do after
Apply it via d3.csv() to convert imported numeric strings and retain only fields needed for a visualization.

Read how D3.js in Action, Third Edition explains data conversion →

Fast Python: High performance techniques for large datasets

How it is used
Protects image-array arithmetic from overflow by widening pixel values before transformation.
How deep it goes
Demonstrates widening, clipping, and recasting through a worked pixel-brightening operation.
Examples
Uses grayscale image pixels, comparing addition and doubling before widening, clipping, and recasting.
What you can do after
Apply NumPy dtype widening, clipping, and recasting to preserve intended pixel values during brightness changes.

Read how Fast Python: High performance techniques for large datasets explains data conversion →

Also covered in

What to know first

Related concepts

Questions about data conversion

What is data conversion?

Data conversion is the transformation of a value or data from one type, format, or representation to another, explicitly or implicitly.

Which Manning books explain data conversion?

Get Programming: Learn to code with Python, Essential TypeScript 5, Third Edition, 100 Java Mistakes and How to Avoid Them, Julia as a Second Language, Python Workout, Second Edition, Learn Rust in a Month of Lunches, 100 C++ Mistakes and How to Avoid Them, Java Persistence with Spring Data and Hibernate epub and 14 more.

What should I know before learning data conversion?

Manning books that teach data conversion usually introduce string, integer, Python and atomic type first.

What is data conversion also called?

Data conversion is also called type conversion, cast, coercion, convert or casting.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.